Comments (2)
What is failing ?
No market functionality is involved
This tests what happens if we start a simulation with an immediate deadline.
What the test expects to happen is to receive 1 period of results.
Instead, sometimes the system is fast enough to return 2 periods.
That fails the test.
Fix
The checking of the deadline has a minor defect.
The simulation code in src/index.js, function run(options)
looks at if ((deadline) && (Date.now()>deadline))
and the "strict greater than" >
will not end the simulation when Date.now()===deadline
. Although Date.now()
should have a 1 ms precision, we don't know how well the system keeps it updated... especially since the highest rate of these was on an HP with an older i5-3000s series processor ... but apparently it is possible to process 2 periods before Date.now()
updates to be greater than deadline.
The fix is to use Date.now()>=deadline
(greater than or equal to) to check the deadline.
This requires two minor changes to the run()
function, once for the synchronous options and once in the asynchronous option.
from single-market-robot-simulator.
Minor fix to deadline code released as version 5.7.0
from single-market-robot-simulator.
Related Issues (15)
- update esdoc HOT 1
- An in-range update of simple-isomorphic-logger is breaking the build 🚨 HOT 3
- test runs with optional "real-time" flag enabled are failing intermittently HOT 2
- Logo proposal HOT 1
- buyer/seller Agent Types are shortened to "t" in trade.csv and other logs HOT 2
- An in-range update of mocha is breaking the build 🚨 HOT 6
- README: add citation for Data In Brief paper HOT 1
- Bad configurations can throw "TypeError: Cannot read property 'length' of undefined"
- ensure numberOfBuyers and numberOfSellers are integers
- 6.9.0 throws TypeError in stand-alone mode while writing out period number HOT 4
- caseid is not reported in orderlogs
- quote log needed HOT 1
- agent type not reported in order log or trade log
- explicitly test KaplanSniper sniping of extreme priced opportunities HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from single-market-robot-simulator.