Fixed value rationalisation

This commit is contained in:
Joshua Barretto 2020-03-31 00:03:56 +01:00
parent 71b8cde266
commit 9daf20e87e

View File

@ -556,7 +556,7 @@ impl Site {
// Update values according to the surplus of each stock
let values = &mut self.values;
self.surplus.iter().for_each(|(stock, surplus)| {
let val = 3.5f32.powf(-*surplus / demand[stock]);
let val = 3.5f32.powf(1.0 - *surplus / demand[stock]);
values[stock] = if val > 0.001 && val < 1000.0 { Some(val) } else { None };
});