Skip to content

Commit

Permalink
Keep commodity prices ordered
Browse files Browse the repository at this point in the history
  • Loading branch information
alexdewar committed Feb 17, 2025
1 parent d38f6d4 commit 4119ab3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/simulation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
use crate::agent::AssetPool;
use crate::model::Model;
use crate::time_slice::TimeSliceID;
use indexmap::IndexMap;
use log::info;
use std::collections::HashMap;
use std::rc::Rc;

pub mod optimisation;
Expand All @@ -18,7 +18,7 @@ type CommodityPriceKey = (Rc<str>, TimeSliceID);

/// A map relating commodity ID + time slice to current price (endogenous)
#[derive(Default)]
pub struct CommodityPrices(HashMap<CommodityPriceKey, f64>);
pub struct CommodityPrices(IndexMap<CommodityPriceKey, f64>);

impl CommodityPrices {
/// Get the price for the given commodity and time slice
Expand Down

0 comments on commit 4119ab3

Please sign in to comment.