Additional documentation on model-state dependent parameters
It would be helpful to include information on how to incorporate user-defined functions within parameters that rely on current states of the model (such as the volume of a storage unit evaluated at each timestep). This feature was briefly mentioned in the README.
Apologies that this is currently lacking. There is some WIP documentation in #652.
The InterpolatedVolumeParameter is an example of a fairly simple parameter that uses current volume to compute a value. It inherits from a shared parent class, but gives the idea.
https://github.com/pywr/pywr/blob/e0cb9cce7e451fd919569654a702482ce949ea21/pywr/parameters/parameters.py#L102
Otherwise please have a look at the ControlCurveInterpolatedParameter. This is slightly complex because it is written in Cython, but its .value() method utilises the current storage of the associated storage node. A similar custom parameter could be written directly in Pyhon.
https://github.com/pywr/pywr/blob/e0cb9cce7e451fd919569654a702482ce949ea21/pywr/parameters/_control_curves.pyx#L168
Thank you for this!
If you get stuck and can paste code here please do and I can help debug it.
Otherwise come chat in our Gitter channel: https://gitter.im/pywr/pywr
Thanks for the feedback!