Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Events that fire at t0 don't work with non-zero start times and delays or the 'time' csymbol #857

Open
luciansmith opened this issue Sep 24, 2021 · 0 comments
Labels

Comments

@luciansmith
Copy link

When an event fires at the start of a simulation (due to its 'initialValue' being set to 'false', but its trigger evaluating to 'true'), there's a couple issues:

  1. if the trigger involves the csymbol 'time', that time is assumed to be zero.
  2. if the event has a delay, the delay is calculated and its 'assignTime' (EventQueue.cpp line 46) is calculated from the model's current time, which is zero.

I think we could clear this up with a revamp of 'reset': currently, the EventQueue is set up with the 'reset' from 'load', and subsequent resets (there's another later on with a time of zero before the simulate function gets involved at all) don't clear it. I think we might revamp reset so that it clears and re-sets the event queue with the current simulation start time, then call it from 'simulate', which is the first time we actually know when the initialTime is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant