gtopt::RightBoundRule struct

Volume-dependent bound rule for water rights.

Defines a piecewise-linear function from a reservoir's volume to the maximum allowed flow/extraction bound. When attached to a FlowRight or VolumeRight, the LP column upper bound is dynamically updated via update_lp using this rule.

Public variables

BoundRuleAxis axis
OptReal cap
OptReal floor
Minimum floor on the computed bound. When unset, defaults to 0.
SingleId reservoir
std::vector<RightBoundSegment> segments

Variable documentation

BoundRuleAxis gtopt::RightBoundRule::axis

Axis driving the rule. Defaults to reservoir_volume so that existing fixtures (Laja, Maule) continue to use the source reservoir's volume without explicit opt-in.

OptReal gtopt::RightBoundRule::cap

Maximum cap on the computed bound (e.g., 5000 m³/s for Laja irrigation rights). When unset, no upper cap is applied.

SingleId gtopt::RightBoundRule::reservoir

Reference reservoir whose volume drives the bound computation. Required when axis == BoundRuleAxis::reservoir_volume (the default). Ignored when the axis does not consume reservoir state.

std::vector<RightBoundSegment> gtopt::RightBoundRule::segments

Piecewise-linear segments (sorted ascending by the axis input). The volume field is the segment's lower breakpoint regardless of which axis is in use — it is the input value at which the segment becomes active, not necessarily a reservoir volume. When empty, the bound rule has no effect.