ValueCondition#
module wntr.network.controls
- class ValueCondition[source]#
Bases:
ControlCondition
Compare a network element attribute to a set value.
- 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
operation (function or str) – A two-parameter comparison function (e.g., numpy.greater, numpy.less_equal), or a string describing the comparison (e.g., ‘=’, ‘below’, ‘is’, ‘>=’, etc.) Words, such as ‘below’, are only accepted from the EPANET rules conditions list (see …)
threshold (float) – A value to compare the source object attribute against
- requires()[source]#
Returns a set of objects required to evaluate this condition
- Returns:
required_objects
- Return type:
OrderedSet of object