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

Enable negative start times. #854

Merged
merged 5 commits into from
Sep 25, 2021
Merged

Enable negative start times. #854

merged 5 commits into from
Sep 25, 2021

Conversation

luciansmith
Copy link

I thought this would be much more difficult than it turned out to be, because our current 'start' time is not 'time to start collecting data' but 'the time that the model is currently in', which is quite different!

The trickiest part of this turns out to be events, which had t0=0.0 hard-coded in quite a number of places. Still need to test more, but many things now work with negative start times--events can fire pre-0.0, even. So hey!

I thought this would be much more difficult than it turned out to be, because our current 'start' time is not 'time to start collecting data' but 'the time that the model is currently in', which is quite different!

The trickiest part of this turns out to be events, which had t0=0.0 hard-coded in quite a number of places.  Still need to test more, but many things now work with negative start times--events can fire pre-0.0, even.  So hey!
Also, put its initialization in a new base class constructor, and call that constructor from the subclass constructors, instead of individually setting the value.

Also also, adjust time vector setting to allow negative time outputs.

Start to test Gillespie; not done yet.
Also, add a bunch of tests.

Also also, it turns out that events that fire at t0 with delay don't interact well with non-zero start times (nor do events that fire at t0 with 'time' in the trigger).  But that's a separate issue and doesn't involve only negative start times; I'll deal with that separately.
Now that it has a memeber variable, it needs to initialize it.  The default constructor was indeed being used elsewhere; I couldn't make the constructor private.
@luciansmith luciansmith merged commit 8101a2f into develop Sep 25, 2021
@luciansmith luciansmith deleted the issue-411-negative-start branch September 25, 2021 03:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant