@@ -13,8 +13,8 @@ define_id_type! {CommodityID}
1313/// A map of [`Commodity`]s, keyed by commodity ID
1414pub type CommodityMap = IndexMap < CommodityID , Rc < Commodity > > ;
1515
16- /// A map of [`CommodityCost `]s, keyed by region ID, year and time slice ID
17- pub type CommodityCostMap = HashMap < ( RegionID , u32 , TimeSliceID ) , CommodityCost > ;
16+ /// A map of [`CommodityLevy `]s, keyed by region ID, year and time slice ID
17+ pub type CommodityLevyMap = HashMap < ( RegionID , u32 , TimeSliceID ) , CommodityLevy > ;
1818
1919/// A map of demand values, keyed by region ID, year and time slice selection
2020pub type DemandMap = HashMap < ( RegionID , u32 , TimeSliceSelection ) , f64 > ;
@@ -40,7 +40,7 @@ pub struct Commodity {
4040 /// every combination of parameters. Note that these values can be negative, indicating an
4141 /// incentive.
4242 #[ serde( skip) ]
43- pub costs : CommodityCostMap ,
43+ pub levies : CommodityLevyMap ,
4444 /// Demand as defined in input files. Will be empty for non-service-demand commodities.
4545 ///
4646 /// The [`TimeSliceSelection`] part of the key is always at the same [`TimeSliceLevel`] as the
@@ -67,9 +67,10 @@ pub enum BalanceType {
6767
6868/// Represents a tax or other external cost on a commodity, as specified in input data.
6969///
70- /// For example, a CO2 price could be specified in input data to be applied to net CO2.
70+ /// For example, a CO2 price could be specified in input data to be applied to net CO2. Note that
71+ /// the value can also be negative, indicating an incentive.
7172#[ derive( PartialEq , Clone , Debug ) ]
72- pub struct CommodityCost {
73+ pub struct CommodityLevy {
7374 /// Type of balance for application of cost
7475 pub balance_type : BalanceType ,
7576 /// Cost per unit commodity
@@ -115,16 +116,16 @@ mod tests {
115116 }
116117
117118 #[ test]
118- fn test_commodity_cost_map ( ) {
119+ fn test_commodity_levy_map ( ) {
119120 let ts = TimeSliceID {
120121 season : "winter" . into ( ) ,
121122 time_of_day : "day" . into ( ) ,
122123 } ;
123- let value = CommodityCost {
124+ let value = CommodityLevy {
124125 balance_type : BalanceType :: Consumption ,
125126 value : 0.5 ,
126127 } ;
127- let mut map = CommodityCostMap :: new ( ) ;
128+ let mut map = CommodityLevyMap :: new ( ) ;
128129 assert ! ( map
129130 . insert( ( "GBR" . into( ) , 2010 , ts. clone( ) ) , value. clone( ) )
130131 . is_none( ) ) ;
0 commit comments