muse2::input::commodity::demand

Function read_demand_from_iter

Source
fn read_demand_from_iter<I>(
    iter: I,
    commodity_ids: &HashSet<Rc<str>>,
    region_ids: &HashSet<Rc<str>>,
    milestone_years: &[u32],
) -> Result<(AnnualDemandMap, CommodityRegionPairs)>
where I: Iterator<Item = Demand>,
Expand description

Read the demand data from an iterator.

§Arguments

  • iter - An iterator of Demands
  • commodity_ids - All possible IDs of commodities
  • region_ids - All possible IDs for regions
  • milestone_years - All milestone years

§Returns

The demand for each combination of commodity, region and year along with a HashSet of all commodity + region pairs included in the file.