Skip to main content

solve_investment_order_for_model

Function solve_investment_order_for_model 

Source
pub fn solve_investment_order_for_model(
    commodity_graphs: &IndexMap<u32, CommoditiesGraph>,
    commodities: &CommodityMap,
    years: &[u32],
) -> HashMap<u32, Vec<MarketSet>>
Expand description

Determine investment ordering for each year

§Arguments

  • commodity_graphs - Commodity graphs for each year, from build_commodity_graphs_for_model
  • commodities - All commodities with their types and demand specifications

§Returns

A map from year to the ordered list of MarketSets for investment decisions. The ordering ensures that leaf-node MarketSets (those with no outgoing edges) are solved first.