Skip to main content

compute_unmet_demand

Function compute_unmet_demand 

Source
fn compute_unmet_demand(
    demand: &DemandMap,
    activity: &IndexMap<TimeSliceID, Activity>,
    commodity: &Commodity,
    asset: &AssetRef,
    time_slice_info: &TimeSliceInfo,
) -> DemandMap
Expand description

Computes remaining unmet demand per time-slice selection after a solve.

For each time-slice selection at the commodity’s balance level, the selection-level residual (demand - supply, clamped to zero) is stored directly. Downstream consumers operate at the selection level (e.g. the next round’s demand constraint and is_any_remaining_demand), so there is no need to distribute values across individual time slices.