Skip to content

Commit 8208998

Browse files
committed
Revert "Restructure"
This reverts commit ddec2e5.
1 parent e787164 commit 8208998

5 files changed

Lines changed: 9 additions & 9 deletions

File tree

src/simulation/investment.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,8 @@ use log::debug;
1717
use std::collections::HashMap;
1818

1919
pub mod appraisal;
20-
pub mod coefficients;
2120
use appraisal::appraise_investment;
22-
use coefficients::calculate_coefficients_for_assets;
21+
use appraisal::coefficients::calculate_coefficients_for_assets;
2322

2423
/// A map of demand across time slices for a specific commodity and region
2524
type DemandMap = IndexMap<TimeSliceID, Flow>;

src/simulation/investment/appraisal.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
//! Calculation for investment tools such as Levelised Cost of X (LCOX) and Net Present Value (NPV).
22
use super::DemandMap;
3-
use super::coefficients::ObjectiveCoefficients;
43
use crate::agent::ObjectiveType;
54
use crate::asset::AssetRef;
65
use crate::commodity::Commodity;
@@ -9,8 +8,11 @@ use crate::model::Model;
98
use crate::units::Capacity;
109
use anyhow::Result;
1110

11+
pub mod coefficients;
1212
mod constraints;
13+
mod costs;
1314
mod optimisation;
15+
use coefficients::ObjectiveCoefficients;
1416
use optimisation::perform_optimisation;
1517

1618
/// The output of investment appraisal required to compare potential investment decisions

src/simulation/investment/coefficients.rs renamed to src/simulation/investment/appraisal/coefficients.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
//! Calculation of cost coefficients for investment tools.
2+
use super::costs::{activity_cost, activity_surplus, annual_fixed_cost};
23
use crate::agent::ObjectiveType;
34
use crate::asset::AssetRef;
45
use crate::model::Model;
@@ -8,12 +9,10 @@ use crate::units::{MoneyPerActivity, MoneyPerCapacity, MoneyPerFlow};
89
use indexmap::IndexMap;
910
use std::collections::HashMap;
1011

11-
mod costs;
12-
use costs::{activity_cost, activity_surplus, annual_fixed_cost};
13-
1412
/// Map storing cost coefficients for an asset.
1513
///
1614
/// These are calculated according to the objective type of the agent owning the asset.
15+
/// Map storing coefficients for each variable
1716
#[derive(Clone)]
1817
pub struct ObjectiveCoefficients {
1918
/// Cost per unit of capacity
@@ -51,7 +50,7 @@ pub fn calculate_coefficients_for_assets(
5150
}
5251

5352
/// Calculates the cost coefficients for LCOX.
54-
fn calculate_coefficients_for_lcox(
53+
pub fn calculate_coefficients_for_lcox(
5554
asset: &AssetRef,
5655
time_slice_info: &TimeSliceInfo,
5756
reduced_costs: &ReducedCosts,
@@ -78,7 +77,7 @@ fn calculate_coefficients_for_lcox(
7877
}
7978

8079
/// Calculates the cost coefficients for NPV.
81-
fn calculate_coefficients_for_npv(
80+
pub fn calculate_coefficients_for_npv(
8281
asset: &AssetRef,
8382
time_slice_info: &TimeSliceInfo,
8483
reduced_costs: &ReducedCosts,
File renamed without changes.

src/simulation/investment/appraisal/optimisation.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! Optimisation problem for investment tools.
2-
use super::super::coefficients::ObjectiveCoefficients;
32
use super::DemandMap;
3+
use super::coefficients::ObjectiveCoefficients;
44
use super::constraints::{
55
add_activity_constraints, add_capacity_constraint, add_demand_constraints,
66
};

0 commit comments

Comments
 (0)