cyclus/core — Issue #17: Allow models to ignore ticks/tocks on some frequency
Author: rwcarlsen
Created: 2012-02-03 19:31:50+00:00
State: open

Allow models to decide how often they will respond to ticks/tocks based on the implicit time step of the model and the user-defined time step of the simulation.

Two notes:
1. this could be embedded in the TimerAgent base class??
2. parents will need to negotiate with their children to pass ticks at least as often as they want them

Comment 1 by project member Princessandsuperman, Nov 28, 2011

As I mentioned, my preference for solving this involves:

1. Having the arbitrary tic/toc call order convention
2. Having all models register for tics/tocs at a certain frequency (takes place in their default constructors)
* the frequency is represented as some integer quantity of time change in some base time unit.
* this removes the need for any tic/toc passing in concrete models (each model deals directly with the timer).
* The timer will need to calculate when to call each model.

Benefits:
1. simplified concrete models (no tic/toc passing)
2. No code outside constructor - the tic/toc methods only contain code relevant to the concrete model - no need for code that is "core framework" code.
3. Better performance (no tic/toc method invocations unless concrete model wants them)
4. Even more performance if: after all registrations are complete, the timer builds a list of all tic/toc/resolve calls for the entire simulation before the sim begins. If there are gaps larger than the base time step with no facility calls, the timer auto-increments the time up to the next tic/toc required.

Disbenefits:
1. facility creation mid-simulation is not as straight forward. Developers need to create facilities during the toc (otherwise the facility may or may not miss its first tic).
2. Others?

In my opinion, this kind of implementation would simplify the core code overall - and simplification is one of my primary metrics for evaluating change desirability. Other opinions?