solve_investment_order_for_model

Function solve_investment_order_for_model 

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

Determine investment ordering for each year

§Arguments

  • commodity_graphs - Commodity graphs for each region and year, outputted 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 InvestmentSets for investment decisions. The ordering ensures that leaf-node InvestmentSets (those with no outgoing edges) are solved first.