avoid economy of scale in economy_tree

This commit is contained in:
Christof Petig 2022-06-07 21:46:41 +02:00
parent 5a965d21c7
commit fca4372205

View File

@ -1421,11 +1421,20 @@ fn direct_use_goods() -> &'static [GoodIndex] {
&*DIRECT_USE
}
#[derive(Default)]
pub struct GraphInfo {
dummy: Economy,
}
impl Default for GraphInfo {
fn default() -> Self {
let mut dummy = Economy::default();
// avoid economy of scale
dummy.pop = 0.0;
dummy.labors.iter_mut().for_each(|l| *l.1 = 0.0);
Self { dummy }
}
}
impl GraphInfo {
pub fn get_orders(&self) -> &'static LaborMap<Vec<(GoodIndex, f32)>> { self.dummy.get_orders() }