ControlAction#
module wntr.network.controls
- class ControlAction[source]#
Bases:
BaseControlAction
A general class for specifying a control action that simply modifies the attribute of an object (target).
- Parameters:
target_obj (object) – The object whose attribute will be changed when the control runs.
attribute (string) – The attribute that will be changed on the target_obj when the control runs.
value (any) – The new value for target_obj.attribute when the control runs.
- notify()#
Call the update method for all observers of this subject.
- requires()[source]#
Returns a set of objects used to evaluate the control
- Returns:
req – The objects required to run the control action.
- Return type:
- subscribe(observer)#
Subscribe observer to this subject. The update method of any observers of this subject will be called when notify is called on this subject.
- Parameters:
observer (Observer)