add_activity_constraints

Function add_activity_constraints 

Source
fn add_activity_constraints<'a, I>(
    problem: &mut RowProblem,
    variables: &VariableMap,
    time_slice_info: &TimeSliceInfo,
    assets: I,
) -> KeysWithOffset<(AssetRef, TimeSliceSelection)>
where I: Iterator<Item = &'a AssetRef> + 'a,
Expand description

Add constraints on the activity of different assets.

This ensures that assets do not exceed their specified capacity and availability for each time slice.

See description in the dispatch optimisation documentation.

Returns an ActivityKeys where offset is the row index of the first activity constraint added and keys enumerates the (asset, time_selection) entries in the same row order. Note that for flexible-capacity assets two rows (upper and lower bounds) are added per selection; in that case the same key is stored twice to match the solver ordering.