Time Manager
The components here provide implementations of different kinds of simulation
clocks for use in vivarium.
For more information about time in the simulation, see the associated concept note.
- class vivarium.engine.framework.time.manager.SimulationClock[source]
A time manager that includes a global clock and simulant-specific clocks.
- setup(builder)[source]
Defines custom actions this manager needs to run during the setup lifecycle phase.
This method is intended to be overridden by subclasses to perform any necessary setup operations specific to the manager. By default, it does nothing.
- initialize_individual_clock(pop_data)[source]
Sets the next_event_time and step_size columns for each simulant
- Return type:
- Parameters:
pop_data (SimulantData)
- simulant_next_event_times(index)[source]
The next time each simulant will be updated.
- Parameters:
index (pd.Index[int])
- Return type:
pd.Series[ClockTime]
- simulant_step_sizes(index)[source]
The step size for each simulant.
- Parameters:
index (pd.Index[int])
- Return type:
pd.Series[ClockStepSize]
- step_forward(index)[source]
Advances the clock by the current step size, and updates aligned simulant clocks.
- Parameters:
index (pd.Index[int])
- Return type:
None
- step_size_post_processor(value, manager)[source]
Computes the largest feasible step size for each simulant.
This is the smallest component-modified step size (rounded down to increments of the minimum step size), or the global step size, whichever is larger. If no components modify the step size, we default to the global step size.
- Return type:
- Parameters:
index – The index of the population for which the attribute is being produced (not used by this post processor but is required to be used by AttributePipelines).
value (Any) – A list of step sizes
manager (ValuesManager) – The ValuesManager for this simulation (not used by this post processor but is required to be used by AttributePipelines).
- Returns:
The largest feasible step size for each simulant (not used by this post processor but is required to be used by AttributePipelines).
- class vivarium.engine.framework.time.manager.SimpleClock[source]
A unitless step-count based simulation clock.
-
CONFIGURATION_DEFAULTS:
dict[str,Any] = {'time': {'end': 100, 'standard_step_size': None, 'start': 0, 'step_size': 1}} A dictionary containing the defaults for any configurations managed by this manager. An empty dictionary indicates no managed configurations.
-
CONFIGURATION_DEFAULTS:
- class vivarium.engine.framework.time.manager.DateTimeClock[source]
A time manager that uses a date-time based simulation clock.
-
CONFIGURATION_DEFAULTS:
dict[str,Any] = {'time': {'end': {'day': 2, 'month': 7, 'year': 2010}, 'standard_step_size': None, 'start': {'day': 2, 'month': 7, 'year': 2005}, 'step_size': 1}} A dictionary containing the defaults for any configurations managed by this manager. An empty dictionary indicates no managed configurations.
-
CONFIGURATION_DEFAULTS: