FunctionCondition#

module wntr.network.controls

class FunctionCondition[source]#

Bases: ControlCondition

A ControlCondition which calls a function to determine if the control needs activated or not. If the function returns True, then the control is activated.


__init__(func, func_kwargs=None, requires=None)[source]#
evaluate()[source]#

Check if the condition is satisfied.

Returns:

check

Return type:

bool

requires()[source]#

Returns a set of objects required to evaluate this condition

Returns:

required_objects

Return type:

OrderedSet of object

property backtrack#

The amount of time by which the simulation should be backed up. Should be updated by the evaluate method if appropriate.

Returns:

backtrack

Return type:

int

property name#

Returns the string representation of the condition.

Returns:

name

Return type:

str