muse2::input::commodity::demand_slicing

Function validate_demand_slices

Source
fn validate_demand_slices(
    commodity_regions: &CommodityRegionPairs,
    demand_slices: &DemandSliceMap,
    time_slice_info: &TimeSliceInfo,
) -> Result<()>
Expand description

Check that the DemandSliceMap is well formed.

Specifically, check:

  • It is non-empty
  • If an entry is provided for any commodity + region pair, there must be entries covering every time slice
  • The demand fractions for all entries related to a commodity + region pair sum to one