-
Notifications
You must be signed in to change notification settings - Fork 21
Conditional end simulation
Eliot McIntire edited this page Feb 2, 2018
·
3 revisions
Is there's a way of stopping the
SpaDES
simulation based on a condition, such as when some variable reaches a certain value?
Simply change the end time of the simulation mid-run: when your condition is met, change the end time to the current time.
Within your module:
if (condition) end(sim) <- time(sim)
With care, you can also manipulate the event queue. For example, if you remove all the events in the queue, then it will the time will proceed until the end time (i.e., end(sim) )
# remove all events in the event queue
if (condition) events(sim) <- events(sim)[0]
- Installation
- Getting started
- Help and package vignettes
- SpaDES 4 dummies
- Try me!
- Debugging
- Caching
- Alternate cache backends
- Frequently asked questions
- SpaDES Users Group
-
Wolves recolonizing the Italian Alps - This is a rewrite in
SpaDES
of Marucco & McIntire 2010.