spork
spork copied to clipboard
spork.sim.history can plausibly return a null-pointer error if time runs out
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.