pywr.domains.river.RiverSplitWithGauge
- class pywr.domains.river.RiverSplitWithGauge(*args, **kwargs)
 A split in the river network with a minimum residual flow.
As per RiverSplit but by default creates another route in the underlying object to model an MRF. This route is such that the MRF is not part of forced ratios. The intent of this object is to model the case where a proportion of flow can be abstracted above the MRF (e.g. 90% of flow above MRF).
/ -->-- X0 {max_flow: mrf, cost: mrf_cost} -->-- \ A -->-- Xo -->-- X1 {max_flow: None, cost: cost} -->-- Xi -->-- C \ -->-- X2 {max_flow: None, cost: 0.0} -->-- / | Bo -->-- Bi --> D Ag {nodes: [X1, X2], factors: factors}
- Parameters:
 - mrffloat
 The minimum residual flow (MRF) at the gauge
- mrf_costfloat
 The cost of the route via the MRF
- costfloat
 The cost of the other (unconstrained) route
- factorsiterable of floats
 The factors to force on the additional splits. Number of extra_slot is assumed to be one less than the length of factors (as per MultiSplitLink documentation).
- slot_namesiterable
 - The identifiers to refer to the slots when connect from this Node. Length must be one more than
 the number of extra slots required.
- __init__(model, *args, mrf=0.0, cost=0.0, mrf_cost=0.0, **kwargs)
 Initialise a new Node object
- Parameters:
 - modelModel
 The model the node belongs to
- namestring
 A unique name for the node
Methods
__init__(model, *args[, mrf, cost, mrf_cost])Initialise a new Node object
after(timestep)Set total flow on this link as sum of sublinks
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
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_max_flow(self)Returns max_flow value if it is a constant parameter or fixed value otherwise returns NaN.
get_constant_min_flow(self)Returns min_flow value if it is a constant parameter or fixed value otherwise returns NaN.
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_fixed_max_flow(self)Returns max_flow value if it is fixed value otherwise returns NaN.
get_fixed_min_flow(self)Returns min_flow value if it is a fixed value otherwise returns NaN.
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
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_isolatedA property to flag whether this Node can be unconnected in a network.
commentcomment: str
component_attrscomponentsGenerator that returns all of the Components attached to the Node
conversion_factorThe conversion between inflow and outflow for the node
costThe cost per unit flow via the node
costsdomainflowTotal flow via this node in the current timestep
fully_qualified_namehas_constant_flowsReturns true if both min_flow and max_flow are literal constants or "constant" Parameters.
has_fixed_costReturns true if cost is not a Parameter.
has_fixed_flowsReturns true if both min_flow and max_flow are not Parameters.
max_flowThe maximum flow constraint on the node
max_flowsmin_flowThe minimum flow constraint on the node
modelThe recorder for the node, e.g. a NumpyArrayRecorder.
mrfmrf_costnameName of the node.
parentThe parent Node/Storage of this object.
prev_flowTotal flow via this node in the previous timestep
recordersReturns a list of pywr.recorders.Recorder objects attached to this node.
virtualvirtual: 'bool'