pywr.nodes.SeasonalVirtualStorage

class pywr.nodes.SeasonalVirtualStorage(*args, **kwargs)

A virtual storage node that operates only for a specified period within a year.

This node is most useful for representing licences that are only enforced during specified periods. The reset_day and reset_month parameters indicate when the node starts operating and the end_day and end_month when it stops operating. For the period when the node is not operating, the volume of the node remains unchanged and the node does not apply any constraints to the model.

The end_day and end_month can represent a date earlier in the year that the reset_day and and reset_month. This situation represents a licence that operates across a year boundary. For example, one that is active between October and March and not active between April and September.

Parameters:
reset_dayint

The day of the month (0-31) when the node starts operating and its volume is reset to the initial value or maximum volume.

reset_monthint

The month of the year (0-12) when the node starts operating and its volume is reset to the initial value or maximum volume.

reset_to_initial_volumebool

Reset the volume to the initial volume instead of maximum volume each year (default is False).

end_dayint

The day of the month (0-31) when the node stops operating.

end_monthint

The month of the year (0-12) when the node stops operating.

__init__(*args, **kwargs)

Methods

__init__(*args, **kwargs)

after(self, Timestep ts, double[)

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_volume(self, double[)

get_all_min_volume(self, double[)

get_area(self, ScenarioIndex scenario_index)

get_cost(self, ScenarioIndex scenario_index)

Get the cost per unit flow at a given timestep

get_current_pc(self, ...)

Return the current proportion of full of the storage node.

get_initial_pc(self)

Returns the initial volume as a proportion.

get_initial_volume(self)

Returns the absolute initial volume.

get_level(self, ScenarioIndex scenario_index)

get_max_volume(self, ...)

get_min_volume(self, ...)

pre_load(model, data)

Create a node instance from data.

reset(self)

setup(self, model)

Called before the first run of the model

Attributes

active

active: 'bool'

allow_isolated

A property to flag whether this Node can be unconnected in a network.

area

comment

comment: basestring

component_attrs

components

Generator that returns all of the Components attached to the Node

cost

The cost per unit increased in volume stored

current_pc

Current proportion full.

domain

factors

flow

Total flow via this node in the current timestep

fully_qualified_name

has_fixed_cost

Returns true if cost is not a Parameter.

initial_volume

initial_volume_pc

level

max_volume

min_volume

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'

volume