pywr.nodes.AggregatedNode
- class pywr.nodes.AggregatedNode(*args, **kwargs)
An aggregated sum of other Node nodes
This object should behave like Node by returning current flow. However this object can not be connected to others within the network.
- Parameters:
- model - `Model` instance
- name - str
- nodes - list or iterable of `Node` objects
The Node objects which to return the sum total of
Notes
This node can not be connected to other nodes in the network.
- __init__(model, name, nodes, flow_weights=None, **kwargs)
Methods
__init__
(model, name, nodes[, flow_weights])after
(self, Timestep ts)before
(self, Timestep ts)Called at the beginning of the timestep
check
(self)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
finalise_load
()Finish loading a node by converting parameter name references to instance references.
finish
(self)get_all_cost
(self, double[)get_all_max_flow
(self, double[)get_all_min_flow
(self, double[)get_constant_factors
(self)Get constant factors.
get_cost
(self, ScenarioIndex scenario_index)get_factors
(self, ScenarioIndex scenario_index)Get node factors for the current timestep and given scenario index.
get_factors_norm
(self, ...)Get node factors normalised by the factor of the first node.
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
pre_load
(model, data)Create a node instance from data.
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
domain
factors
flow
Total flow via this node in the current timestep
flow_weights
fully_qualified_name
has_constant_factors
Returns true if all factors are is_constant==True
has_fixed_factors
Returns true if all factors are of type ConstantParameter
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. a NumpyArrayRecorder.
name
Name of the node.
nodes
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'