fn calculate_full_cost_prices<'a, I, J>(
activity_keys_for_existing: I,
activity_keys_for_candidates: J,
annual_activities: &HashMap<AssetRef, Activity>,
upstream_prices: &CommodityPrices,
year: u32,
markets_to_price: &HashSet<(CommodityID, RegionID)>,
) -> HashMap<(CommodityID, RegionID, TimeSliceID), MoneyPerFlow>where
I: Iterator<Item = (&'a AssetRef, &'a TimeSliceID)>,
J: Iterator<Item = (&'a AssetRef, &'a TimeSliceID)>,Expand description
Calculate full cost prices for a set of commodities.
This pricing strategy aims to incorporate the full cost of commodity production into the price.
For a given asset, a full cost can be calculated for each SED/SVD output, which is the sum of:
- Annual capital costs/fixed operating costs: Calculated based on the capacity of the asset and the total annual output. If an asset has multiple SED/SVD outputs, then these costs are shared equally over all outputs according to their flow coefficients.
- Generic activity costs: Activity-related costs not tied to a specific SED/SVD output (variable operating costs, cost of purchasing inputs, plus all levies and flow costs not associated with specific SED/SVD outputs). As above, these are shared over all SED/SVD outputs according to their flow coefficients.
- Commodity-specific activity costs: flow costs/levies for the specific SED/SVD output.
For example, consider an asset A(SED) -> B(SED) + 2C(SED) + D(OTH), with the following costs:
- Annual capital cost + fixed operating cost: 2.5 per unit capacity
- Variable operating cost: 5 per unit activity
- Production levy on C: 3 per unit flow
- Production levy on D: 4 per unit flow
- Shadow price of A: 1 per unit flow
If capacity is 4 and annual activity is 2:
- Annual capital + fixed operating cost per activity = (2.5 * 4) / 2 = 5
- Annual capital + fixed operating cost per SED/SVD output = 5 / (1 + 2) = 1.666
- Generic activity cost per activity = (1 + 5 + 4) = 10
- Generic activity cost per SED/SVD output = 10 / (1 + 2) = 3.333
- Full cost of B = 1.666 + 3.333 = 5.0
- Full cost of C = 1.666 + 3.333 + 3 = 8.0
For each region, the price in each time slice is taken from the installed asset with the highest full cost (excluding assets with zero annual activity, as the full cost of these as calculated above would be infinite). If there are no producers of the commodity in that region (in particular, this may occur when there’s no demand for the commodity), then candidate assets are considered: we take the price from the candidate asset with the lowest full cost, assuming maximum possible dispatch (i.e. the single candidate asset that would be most competitive if a small amount of demand was added).
§Arguments
activity_keys_for_existing- Iterator over activity keys from optimisation solution for existing assetsactivity_keys_for_candidates- Iterator over activity keys from optimisation solution for candidate assetsannual_activities- Map of annual activities for each asset computed bycalculate_annual_activities. This only needs to include existing assets.upstream_prices- Prices for commodities upstream of the ones we are calculating prices foryear- The year for which prices are being calculatedmarkets_to_price- Set of markets to calculate full cost prices for
§Returns
A map of full cost prices for the specified markets in all time slices