pywr.parameters.control_curves.ControlCurveParameter

class pywr.parameters.control_curves.ControlCurveParameter(model, storage_node, control_curves, values=None, parameters=None, variable_indices=None, upper_bounds=None, lower_bounds=None, **kwargs)

A generic multi-levelled control curve Parameter.

This parameter can be used to return different values when a Storage node’s current

volumes is at different percentage of max_volume relative to predefined control curves. Control curves must be defined in the range [0, 1] corresponding to 0% and 100% volume.

By default this parameter returns an integer sequence from zero if the first control curve

is passed, and incrementing by one for each control curve (or “level”) the Storage node is below.

Parameters:
storage_nodeStorage

An optional Storage node that can be used to query the current percentage volume.

control_curvesfloat, int or Parameter object, or iterable thereof

The position of the control curves. Internally float or int types are cast to ConstantParameter. Multiple values correspond to multiple control curve positions. These should be specified in descending order.

valuesarray_like or None, optional

The values to return if the Storage object is above the correspond control curve. I.e. the first value is returned if the current volume is above the first control curve, and second value if above the second control curve, and so on. The length of values must be one more than than the length of control_curves.

parametersiterable Parameter objects or None, optional

If values is None then parameters can specify a Parameter object to use at level of the control curves. In the same way as values the first Parameter is used if Storage is above the first control curve, and second Parameter if above the second control curve, and so on.

variable_indicesiterable of ints, optional
A list of indices that correspond to items in values which are to be considered variables

when self.is_variable is True. This mechanism allows a subset of values to be variable.

lower_bounds, upper_boundsarray_like, optional
Bounds of the variables. The length must correspond to the length of variable_indices, i.e.

there are bounds for each index to be considered as a variable.

Notes

If values and parameters are both None, the default, then values defaults to

a range of integers, starting at zero, one more than length of control_curves.

__init__(*args, **kwargs)

Methods

__init__(*args, **kwargs)

after(self)

before(self)

finish(self)

get_all_values(self)

get_constant_value(self)

Return a constant value.

get_double_lower_bounds(self)

get_double_upper_bounds(self)

get_double_variables(self)

get_integer_lower_bounds(self)

get_integer_upper_bounds(self)

get_integer_variables(self)

get_value(self, ScenarioIndex scenario_index)

load(cls, model, data)

register(cls)

reset(self)

set_double_variables(self, double[)

set_integer_variables(self, int[)

setup(self)

unregister(cls)

value(self, Timestep ts, ...)

Attributes

children

comment

comment: unicode

control_curves

double_size

double_size: 'int'

integer_size

integer_size: 'int'

is_constant

is_variable

is_variable: 'bool'

model

name

parameters

parameters: list

parents

size

storage_node

tags

tags: dict

values

variable_indices