pywr.nodes.DelayNode¶
-
class
pywr.nodes.
DelayNode
(*args, **kwargs)¶ A node that delays flow for a given number of timesteps or days.
This is a composite node consisting internally of an Input and an Output node. A FlowDelayParameter is used to delay the flow of the output node for a given period prior to this delayed flow being set as the flow of the input node. Connections to the node are connected to the internal output node and connection from the node are connected to the internal input node node.
- Parameters
- modelpywr.model.Model
- namestring
Name of the node.
- timesteps: int
Number of timesteps to delay the flow.
- days: int
Number of days to delay the flow. Specifying a number of days (instead of a number of timesteps) is only valid if the number of days is exactly divisible by the model timestep delta.
- initial_flow: float
Flow provided by node for initial timesteps prior to any delayed flow being available. This is constant across all delayed timesteps and any model scenarios. Default is 0.0.
-
__init__
(model, name, **kwargs)¶ Initialise a new Node object
- Parameters
- modelModel
The model the node belongs to
- namestring
A unique name for the node
Methods
__init__
(model, name, **kwargs)Initialise a new Node object
after
(self, Timestep ts)before
(self, Timestep ts)Called at the beginning of the timestep
check
()Check the node is valid
commit
(self, int scenario_index, double value)Called once for each route the node is a member of
commit_all
(self, double[)Called once for each route the node is a member of
connect
(node[, from_slot, to_slot])Create an edge from this Node to another Node
disconnect
([node, slot_name, all_slots])Remove a connection from this Node to another Node
finish
(self)get_conversion_factor
(self)Get the conversion factor
get_cost
(self, ScenarioIndex scenario_index)Get the cost per unit flow at a given timestep
get_max_flow
(self, ScenarioIndex scenario_index)Get the maximum flow at a given timestep
get_min_flow
(self, ScenarioIndex scenario_index)Get the minimum flow at a given timestep
iter_slots
([slot_name, is_connector])Returns the object(s) wich should be connected to given slot_name
load
(data, model)reset
(self)Called at the beginning of a run
setup
(self, model)Called before the first run of the model
Attributes
allow_isolated
A property to flag whether this Node can be unconnected in a network.
comment
comment: basestring
component_attrs
components
Generator that returns all of the Components attached to the Node
conversion_factor
The conversion between inflow and outflow for the node
cost
The cost per unit flow via the node
domain
flow
Total flow via this node in the current timestep
fully_qualified_name
max_flow
The maximum flow constraint on the node
min_flow
The minimum flow constraint on the node
model
The recorder for the node, e.g.
name
Name of the node.
parent
The parent Node/Storage of this object.
prev_flow
Total flow via this node in the previous timestep
recorders
Returns a list of pywr.recorders.Recorder objects attached to this node.
virtual
virtual: ‘bool’