Skip to main content

price_cycle

Function price_cycle 

Source
fn price_cycle(
    model: &Model,
    solution_without_candidates: &Solution<'_>,
    solution_with_candidates: &Solution<'_>,
    year: u32,
    markets: &[(CommodityID, RegionID)],
    shadow_prices: &PriceMap,
    annual_activities: &mut Option<HashMap<AssetRef, Activity>>,
    market_prices: &mut PriceMap,
    strategy_override: Option<PricingStrategy>,
)
Expand description

Calculate prices for a set of cyclically-dependent markets, updating market_prices.

Markets should be ordered in the input slice according to the direction of dependencies (downstream markets first) as solved by order_sccs. Prices are calculated in the reverse of this order (i.e. upstream markets first), with an iterative loop to allow for feedback between markets.