spork icon indicating copy to clipboard operation
spork copied to clipboard

spork.sim.history can plausibly return a null-pointer error if time runs out

Open joinr opened this issue 6 years ago • 0 comments

For computing the simulation history, we're using sim.core/get-time to get the current time of the frame. If time runs out, the agenda is nil, thus no times are returned. This can then lead to an obscure null-pointer error when we go to determine if we should continue taking frames. Currently, we say (<= (sim/get-time ctx) tfinal), but tfinal is an upper bound on the time-horizon. So if get-time returns nil (we're all done with events), then we get a numerical comparison between nil and a long.

Solution: modify the take-while filter to include the notion of time returning nil, thus indicating an early termination.

joinr avatar Mar 08 '18 08:03 joinr