pywrdrb.parameters.VolBalanceNYCDemand#

class pywrdrb.parameters.VolBalanceNYCDemand(model, reservoir, nodes, max_volume_agg_nyc, volume_agg_nyc, max_flow_delivery_nyc, flow_agg_nyc, max_vol_reservoirs, vol_reservoirs, flow_reservoirs, hist_max_flow_delivery_nycs, mrf_target_individual_reservoirs, downstream_release_target_reservoirs, flood_release_reservoirs, **kwargs)#

Computes NYC reservoir delivery targets to meet downstream demands while balancing relative storage across the system.

This parameter allocates NYC delivery volume across the three upstream reservoirs (Cannonsville, Pepacton, Neversink) based on storage and inflow conditions, maximum diversion capacity, and existing release obligations. The goal is to keep reservoir storage levels balanced while fulfilling the NYC system delivery target.

See comments on this GitHub issue for the equations and logic: users/ahamilton144

reservoir#

The name of the NYC reservoir associated with this instance.

Type:

str

nodes#

List of model nodes corresponding to NYC reservoirs.

Type:

list

num_reservoirs#

Number of NYC reservoirs (typically 3).

Type:

int

max_volume_agg_nyc#

Total maximum volume capacity of the combined NYC reservoir system.

Type:

Parameter

volume_agg_nyc#

Total current volume of the combined NYC reservoir system.

Type:

Parameter

max_flow_delivery_nyc#

Maximum allowed total delivery to NYC at the current time.

Type:

Parameter

flow_agg_nyc#

Current total flow delivered to NYC from all reservoirs.

Type:

Parameter

max_vol_reservoirs#

Maximum volume for each individual NYC reservoir.

Type:

list of Parameter

vol_reservoirs#

Current volume for each NYC reservoir.

Type:

list of Parameter

flow_reservoirs#

Current delivery flow for each NYC reservoir.

Type:

list of Parameter

hist_max_flow_delivery_nycs#

Historical maximum diversion rate for each NYC reservoir.

Type:

list of Parameter

mrf_target_individual_reservoirs#

Minimum required release (mandated) for each NYC reservoir under FFMP.

Type:

list of Parameter

downstream_release_target_reservoirs#

Additional downstream release obligations for each NYC reservoir.

Type:

list of Parameter

flood_release_reservoirs#

Flood mitigation releases scheduled for each NYC reservoir.

Type:

list of Parameter

value(timestep, scenario_index)#

Calculates the delivery target for the specific NYC reservoir to balance storage and meet total delivery needs.

load(model, data)#

Class method to initialize the parameter from a Pywr model and input data dictionary.

Notes

This parameter helps balance the NYC system’s deliveries while preserving storage equity. The delivery calculation is performed separately for each reservoir instance, due to Pywr’s scalar parameter constraints.

__init__(model, reservoir, nodes, max_volume_agg_nyc, volume_agg_nyc, max_flow_delivery_nyc, flow_agg_nyc, max_vol_reservoirs, vol_reservoirs, flow_reservoirs, hist_max_flow_delivery_nycs, mrf_target_individual_reservoirs, downstream_release_target_reservoirs, flood_release_reservoirs, **kwargs)#

Initialize an instance of the VolBalanceNYCDemand parameter.

Parameters:
  • model (Model) – Pywr model object.

  • reservoir (str) – Name of the NYC reservoir for which this parameter instance applies.

  • nodes (list) – List of Pywr reservoir nodes (Cannonsville, Pepacton, Neversink).

  • max_volume_agg_nyc (Parameter) – Total maximum volume of the NYC reservoir system.

  • volume_agg_nyc (Parameter) – Combined current volume of the NYC reservoir system.

  • max_flow_delivery_nyc (Parameter) – Target total NYC delivery rate.

  • flow_agg_nyc (Parameter) – Current combined delivery from all reservoirs to NYC.

  • max_vol_reservoirs (list of Parameter) – Maximum storage capacity for each reservoir.

  • vol_reservoirs (list of Parameter) – Current volume for each reservoir.

  • flow_reservoirs (list of Parameter) – Current delivery flow for each reservoir.

  • hist_max_flow_delivery_nycs (list of Parameter) – Historical maximum delivery constraints for each reservoir.

  • mrf_target_individual_reservoirs (list of Parameter) – Minimum flow release requirements for each reservoir (e.g., FFMP).

  • downstream_release_target_reservoirs (list of Parameter) – Required additional downstream releases per reservoir.

  • flood_release_reservoirs (list of Parameter) – Flood control releases per reservoir.

  • **kwargs – Additional keyword arguments for base Parameter class.

Notes

The value method internally repeats balancing calculations for each reservoir individually because array-valued parameters are not natively supported in Pywr.

Methods

__init__(model, reservoir, nodes, ...)

Initialize an instance of the VolBalanceNYCDemand parameter.

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(model, data)

Load and initialize the VolBalanceNYCDemand parameter from model and config data.

register(cls)

reset(self)

set_double_variables(self, double[)

set_integer_variables(self, int[)

setup(self)

unregister(cls)

value(timestep, scenario_index)

Calculate the NYC delivery target for this reservoir that balances storage and meets system-wide demand.

Attributes

children

comment

str

double_size

'int'

integer_size

'int'

is_constant

is_variable

'bool'

model

name

parents

size

tags

dict