We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6e89b39 commit 466d7cdCopy full SHA for 466d7cd
1 file changed
src/simulation/optimisation.rs
@@ -194,8 +194,12 @@ fn add_variables(
194
}
195
196
/// Calculate the cost coefficient for a decision variable
197
-fn calculate_cost_coefficient(_asset: &Asset, _year: u32, _time_slice: &TimeSliceID) -> f64 {
198
- // **TODO:** Calculate cost coefficient here:
199
- // https://github.com/EnergySystemsModellingLab/MUSE_2.0/issues/590
200
- 1.0
+fn calculate_cost_coefficient(asset: &Asset, year: u32, time_slice: &TimeSliceID) -> f64 {
+ // The cost for all commodity flows (including levies/incentives)
+ let flows_cost: f64 = asset
+ .iter_flows()
201
+ .map(|flow| flow.get_total_cost(&asset.region_id, year, time_slice))
202
+ .sum();
203
+
204
+ asset.process_parameter.variable_operating_cost + flows_cost
205
0 commit comments