add_commodity_balance_constraints

Function add_commodity_balance_constraints 

Source
fn add_commodity_balance_constraints<'a, I>(
    problem: &mut RowProblem,
    variables: &VariableMap,
    model: &'a Model,
    assets: &I,
    markets_to_balance: &'a [(CommodityID, RegionID)],
    year: u32,
) -> KeysWithOffset<(CommodityID, RegionID, TimeSliceSelection)>
where I: Iterator<Item = &'a AssetRef> + Clone + 'a,
Expand description

Add asset-level input-output commodity balances.

These constraints fix the supply-demand balance for the whole system.

See description in the dispatch optimisation documentation.

Returns a CommodityBalanceKeys where offset is the row index of the first commodity-balance constraint added to problem and keys lists the (commodity, region, time_selection) entries in the same order as the rows.