Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Base class for recording information from a pywr.model.Model.
Recorder components are used to calculate, aggregate and save data from a simulation. This base class provides the basic functionality for all recorders. API Reference
model
pywr.core.Model
Yes
agg_func
Scenario aggregation function to use when aggregated_value is called
Yes
name
Name of the recorder
comment
Comment or description of the recorder
ignore_nan
Flag to ignore NaN values when calling aggregated_value
is_objective
Flag to denote the direction, if any, of optimisation undertaken with this recorder
epsilon
Epsilon distance used by some optimisation algorithms
constraint_lower_bounds, constraint_upper_bounds
The value(s) to use for lower and upper bound definitions. These values determine whether the recorder instance is marked as a constraint. Either bound can be None (the default) to disable the respective bound. If both bounds are None then the is_constraint property will return False. The lower bound must be strictly less than the upper bound. An equality constraint can be created by setting both bounds to the same value.
The constraint bounds are not used during model simulation. Instead they are intended for use by optimisation wrappers (or other external tools) to define constrained optimisation problems.
coming soon...
model
pywr.core.Model
Yes
param
The parameter to record
Yes
agg_func
Scenario aggregation function to use when aggregated_value is called
Yes
name
Name of the recorder
Yes
comment
Comment or description of the recorder
Yes
ignore_nan
Flag to ignore NaN values when calling aggregated_value
Yes
is_objective
Flag to denote the direction, if any, of optimisation undertaken with this recorder
Yes
epsilon
Epsilon distance used by some optimisation algorithms
Yes
constraint_lower_bounds, constraint_upper_bounds
The value(s) to use for lower and upper bound definitions. These values determine whether the recorder instance is marked as a constraint. Either bound can be None (the default) to disable the respective bound. If both bounds are None then the is_constraint property will return False. The lower bound must be strictly less than the upper bound. An equality constraint can be created by setting both bounds to the same value.
The constraint bounds are not used during model simulation. Instead they are intended for use by optimisation wrappers (or other external tools) to define constrained optimisation problems.
Yes
coming soon...
Base class for recorders that track Parameter values. API Reference
model
pywr.core.Model
Yes
param
The parameter to record
Yes
agg_func
Scenario aggregation function to use when aggregated_value is called
Yes
name
Name of the recorder
Yes
comment
Comment or description of the recorder
Yes
ignore_nan
Flag to ignore NaN values when calling aggregated_value
Yes
is_objective
Flag to denote the direction, if any, of optimisation undertaken with this recorder
Yes
epsilon
Epsilon distance used by some optimisation algorithms
Yes
constraint_lower_bounds, constraint_upper_bounds
The value(s) to use for lower and upper bound definitions. These values determine whether the recorder instance is marked as a constraint. Either bound can be None (the default) to disable the respective bound. If both bounds are None then the is_constraint property will return False. The lower bound must be strictly less than the upper bound. An equality constraint can be created by setting both bounds to the same value.
The constraint bounds are not used during model simulation. Instead they are intended for use by optimisation wrappers (or other external tools) to define constrained optimisation problems.
Yes
coming soon...
model
pywr.core.Model
Yes
agg_func
Scenario aggregation function to use when aggregated_value is called
Yes
name
Name of the recorder
comment
Comment or description of the recorder
ignore_nan
Flag to ignore NaN values when calling aggregated_value
is_objective
Flag to denote the direction, if any, of optimisation undertaken with this recorder
epsilon
Epsilon distance used by some optimisation algorithms
constraint_lower_bounds, constraint_upper_bounds
The value(s) to use for lower and upper bound definitions. These values determine whether the recorder instance is marked as a constraint. Either bound can be None (the default) to disable the respective bound. If both bounds are None then the is_constraint property will return False. The lower bound must be strictly less than the upper bound. An equality constraint can be created by setting both bounds to the same value.
The constraint bounds are not used during model simulation. Instead they are intended for use by optimisation wrappers (or other external tools) to define constrained optimisation problems.
coming soon...
Utility class for computing aggregate values.
Users are unlikely to use this class directly. Instead Recorder sub-classes will use this functionality to aggregate their results across different dimensions (e.g. time, scenarios, etc.). API Reference
func
The aggregation function to use. Can be a string or dict defining aggregation functions, or a callable custom function that performs aggregation.
When a string it can be one of: “sum”, “min”, “max”, “mean”, “median”, “product”, or “count_nonzero”. These strings map to and cause the aggregator to use the corresponding numpy functions.
A dict can be provided containing a “func” key, and optional “args” and “kwargs” keys. The value of “func” should be a string corresponding to the aforementioned numpy function names with the additional options of “percentile” and “percentileofscore”. These latter two functions require additional arguments (the percentile and score) to function and must be provided as the values in either the “args” or “kwargs” keys of the dictionary. Please refer to the corresponding numpy (or scipy) function definitions for documentation on these arguments.
Finally, a callable function can be given. This function must accept either a 1D or 2D numpy array as the first argument, and support the “axis” keyword as integer value that determines which axis over which the function should apply aggregation. The axis keyword is only supplied when a 2D array is given. Therefore,` the callable function should behave in a similar fashion to the numpy functions.
Yes
func_args
func_args: list
Yes
func_kwargs
func_kwargs: dict
Yes
model
pywr.core.Model
Yes
agg_func
Scenario aggregation function to use when aggregated_value is called
Yes
name
Name of the recorder
comment
Comment or description of the recorder
ignore_nan
Flag to ignore NaN values when calling aggregated_value
is_objective
Flag to denote the direction, if any, of optimisation undertaken with this recorder
epsilon
Epsilon distance used by some optimisation algorithms
constraint_lower_bounds, constraint_upper_bounds
The value(s) to use for lower and upper bound definitions. These values determine whether the recorder instance is marked as a constraint. Either bound can be None (the default) to disable the respective bound. If both bounds are None then the is_constraint property will return False. The lower bound must be strictly less than the upper bound. An equality constraint can be created by setting both bounds to the same value.
The constraint bounds are not used during model simulation. Instead they are intended for use by optimisation wrappers (or other external tools) to define constrained optimisation problems.
coming soon...