CIF simulator trace input mode: can't replay trace exactly for time transitions
The problem
If we execute some model in the browser (see #272 (closed)), and export that as a trace file to replay that in the CIF simulator, that won't be exactly the same. We can indicate in the trace file that time may pass, or may not pass, but we can't force that time must pass before the next event.
For instance, if time may pass and certain SVG input elements may be clicked to cause some SVG input events to happen, then in the trace input mode there is no SVG input component, and thus the events can happen at any time. Then, if time can pass and the event is enabled, the event will immediately happen, not after some time. Thus, the original simulation/execution in the browser can't be exactly replayed in the simulator.
Proposed solution
I propose to:
- Add another
time
mode (maybe named 'exact'). - Allow the
time
command to have a duration, e.g.,time 1.5
rather than justtime
. It would not be allowed to specify the duration for the other time modes, and it must be specified for theexact
mode. - For
time 1.5
, a time transition must be taken, and must last for 'exactly' 1.5 time units. Although, there may be a slight difference in time passing, due to numeric computation, ODE solvers, etc, and thus double values not being exact.