I’m using the Java interface (Java 11, Windows 10, 64-bit), and my application can run multiple scenarios (e.g., open a scenario and run it, then open a different scenario and run that, etc.).
My current approach is to throw away the
PulseEngine object and create a new one (specifically, I call
PulseEngine.cleanUp(), and then let Java garbage collection take it from there). This works fine if the engine is not running. However, if the engine is in the middle of advancing time, then the jvm crashes. I don’t see a way to cancel a run.
Is my approach to “resetting” valid, or should I be trying to reuse the engine? How can I cancel an in-progress run, or at least wait for it to complete? (Cancelling would be better, because it is possible that the run is long.)