Skip to content

Commit 466d7cd

Browse files
committed
Add new cost coefficient calculation
Closes #590.
1 parent 6e89b39 commit 466d7cd

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

src/simulation/optimisation.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,12 @@ fn add_variables(
194194
}
195195

196196
/// 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
197+
fn calculate_cost_coefficient(asset: &Asset, year: u32, time_slice: &TimeSliceID) -> f64 {
198+
// The cost for all commodity flows (including levies/incentives)
199+
let flows_cost: f64 = asset
200+
.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
201205
}

0 commit comments

Comments
 (0)