Skip to content

Commit 0baef4c

Browse files
committed
Merge branch 'main' into move-settings.toml-from-model-dir
2 parents 30e5e08 + f6ff308 commit 0baef4c

27 files changed

Lines changed: 811 additions & 402 deletions

Cargo.lock

Lines changed: 45 additions & 25 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ indexmap = "2.9.0"
3131
human-panic = "2.0.2"
3232
clap-markdown = "0.1.5"
3333
platform-info = "2.0.5"
34+
derive_more = "0.99"
3435

3536
[dev-dependencies]
3637
current_dir = "0.1.2"

src/agent.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ use crate::commodity::CommodityID;
44
use crate::id::{define_id_getter, define_id_type};
55
use crate::process::Process;
66
use crate::region::RegionID;
7+
use crate::units::{Dimensionless, Money};
78
use indexmap::IndexMap;
89
use serde_string_enum::DeserializeLabeledStringEnum;
910
use std::collections::HashMap;
@@ -19,7 +20,7 @@ pub type AgentMap = IndexMap<AgentID, Agent>;
1920
pub type AgentCostLimitsMap = HashMap<u32, AgentCostLimits>;
2021

2122
/// A map of commodity portions for an agent, keyed by commodity and year
22-
pub type AgentCommodityPortionsMap = HashMap<(CommodityID, u32), f64>;
23+
pub type AgentCommodityPortionsMap = HashMap<(CommodityID, u32), Dimensionless>;
2324

2425
/// A map for the agent's search space, keyed by commodity and year
2526
pub type AgentSearchSpaceMap = HashMap<(CommodityID, u32), Rc<Vec<Rc<Process>>>>;
@@ -56,9 +57,9 @@ define_id_getter! {Agent, AgentID}
5657
#[derive(Debug, Clone, PartialEq)]
5758
pub struct AgentCostLimits {
5859
/// The maximum capital cost the agent will pay.
59-
pub capex_limit: Option<f64>,
60+
pub capex_limit: Option<Money>,
6061
/// The maximum annual operating cost (fuel plus var_opex etc) that the agent will pay.
61-
pub annual_cost_limit: Option<f64>,
62+
pub annual_cost_limit: Option<Money>,
6263
}
6364

6465
/// The decision rule for a particular objective

0 commit comments

Comments
 (0)