pywr.core.Scenario

class pywr.core.Scenario(model, name, int size=1, slice slice=None, ensemble_names=None)

Represents a scenario in the model.

Typically a scenario will be used to run many similar models simultaneously. A small number of Parameter objects in the model will return different values depending on the scenario, but many will not. Multiple scenarios can be defined such that some Parameter values vary with one scenario, but not another. Scenarios are defined with a size that represents the number of ensembles in that scenario.

Parameters:
modelpywr.core.Model

The model instance to attach the scenario to.

namestr

The name of the scenario.

sizeint, optional

The number of ensembles in the scenario. The default value is 1.

sliceslice, optional
If given this defines the subset of the ensembles that are actually run

in the model. This is useful if a large number of ensembles is defined, but certain analysis (e.g. optimisation) can only be done on a small subset.

ensemble_namesiterable of str, optional

User defined names describing each ensemble.

__init__(*args, **kwargs)

Methods

__init__(*args, **kwargs)

Attributes

ensemble_names

name

size

slice

slice: slice