ControlBase#

module wntr.network.controls

class ControlBase[source]#

Bases: object

This is the base class for all control objects. Control objects are used to check the conditions under which a ControlAction should be run. For example, if a pump is supposed to be turned on when the simulation time reaches 6 AM, the ControlAction would be “turn the pump on”, and the ControlCondition would be “when the simulation reaches 6 AM”.


__init__()[source]#
abstract actions()[source]#

Returns a list of all actions used by this control.

Returns:

act

Return type:

list of BaseControlAction

abstract is_control_action_required()[source]#

This method is called to see if any action is required by this control object. This method returns a tuple that indicates if action is required (a bool) and a recommended time for the simulation to backup (in seconds as a positive int).

Returns:

req – A tuple (bool, int) indicating if an action should be run and how far to back up the simulation.

Return type:

tuple

abstract requires()[source]#

Returns a set of objects required for this control.

Returns:

required_objects

Return type:

OrderedSet of object

abstract run_control_action()[source]#

This method is called to run the control action after a call to IsControlActionRequired indicates that an action is required.

property condition#
property priority#