add_demand_constraints

Function add_demand_constraints 

Source
pub fn add_demand_constraints(
    problem: &mut RowProblem,
    asset: &AssetRef,
    commodity: &Commodity,
    time_slice_info: &TimeSliceInfo,
    demand: &IndexMap<TimeSliceID, Flow>,
    activity_vars: &IndexMap<TimeSliceID, Col>,
    unmet_demand_vars: &IndexMap<TimeSliceID, Col>,
)
Expand description

Adds demand constraints to the problem.

Constrains supply to be less than or equal to demand. This is implemented as an equality across each time-slice selection: supply (activity terms, scaled by flow coefficients) plus the unmet_demand variables equals the total demand for that selection, so non-negative unmet_demand enforces supply ≤ demand. The selections follow the commodity’s balance level.