DrPaulBrewer / single-market-robot-simulator

Runs numerical experiments for a single market populated by robot traders
Other
7 stars 5 forks source link

ensure numberOfBuyers and numberOfSellers are integers #33

Closed DrPaulBrewer closed 3 years ago

DrPaulBrewer commented 4 years ago

Morphing code's floating pointing interpolation does not guarantee integers: 13.9999999998

Proposed solution is to apply Math.round() in each of these statements.

https://github.com/DrPaulBrewer/single-market-robot-simulator/blob/33ae967bf4b340e012262cd5476cbd3838716627/src/index.js#L235-L236