iter_existing_asset_max_prices

Function iter_existing_asset_max_prices 

Source
fn iter_existing_asset_max_prices<'a, I>(
    activity_for_existing: I,
    markets_to_price: &HashSet<(CommodityID, RegionID)>,
    existing_prices: &CommodityPrices,
    year: u32,
    commodities: &CommodityMap,
    pricing_strategy: &PricingStrategy,
    annual_activities: Option<&HashMap<AssetRef, Activity>>,
) -> impl Iterator<Item = ((CommodityID, RegionID, TimeSliceSelection), MoneyPerFlow)> + 'a
where I: Iterator<Item = (&'a AssetRef, &'a TimeSliceID, Activity)>,
Expand description

Calculate prices as the maximum cost across existing assets, using either a marginal cost or full cost strategy (depending on pricing_strategy). Prices are given for each commodity in the granularity of the commodity’s time slice level. For seasonal/annual commodities, this involves taking a weighted average across time slices for each asset according to activity (with a backup weight based on potential activity if there is zero activity across the selection, and omitting prices in the extreme case of zero potential activity).

§Arguments

  • activity_for_existing - Iterator over (asset, time slice, activity) tuples for existing assets
  • markets_to_price - Set of (commodity, region) pairs to attempt to price
  • existing_prices - Current commodity prices (used to calculate marginal costs)
  • year - Year for which prices are being calculated
  • commodities - Commodity map
  • pricing_strategy - Pricing strategy, either MarginalCost or FullCost
  • annual_activities - Optional annual activities (required for full cost pricing)

§Returns

An iterator of ((commodity, region, time slice selection), price) tuples for the calculated prices. This will include all (commodity, region) combinations in markets_to_price for time slice selections where a price could be determined.