RelativeCondition#
module wntr.network.controls
- class RelativeCondition[source]#
Bases:
ControlCondition
Compare attributes of two different objects (e.g., levels from tanks 1 and 2) This type of condition does not work with the EpanetSimulator, only the WNTRSimulator.
- Parameters:
source_obj (object) – The object (such as a Junction, Tank, Pipe, etc.) to use in the comparison
source_attr (str) – The attribute of the object (such as level, pressure, setting, etc.) to compare against the threshold
relation (function) – A numpy or other comparison method that takes two values and returns a bool (e.g., numpy.greater, numpy.less_equal)
threshold_obj (object) – The object (such as a Junction, Tank, Pipe, etc.) to use in the comparison of attributes
threshold_attr (str) – The attribute to used in the comparison evaluation
- requires()[source]#
Returns a set of objects required to evaluate this condition
- Returns:
required_objects
- Return type:
OrderedSet of object