src.system.projection.Projection¶
- class src.system.projection.Projection(projection_parameters: ProjectionParameters, data_sources: DataSourcesRoot)¶
Abstract class that represents a projection moving forward through time. Inherit this class to implement a projection.
Inheritance Diagram

Variables & Properties
Projection parameters.
Projection-wide timekeeping object.
Data sources to be read at runtime.
Output directory path to place projection output.
Methods
__init__(projection_parameters, data_sources)Constructor method.
By default, evaluating this method can trigger a halt in the
main projection loop.Abstract method that is called every time step.
Runs the main projection loop, projecting forward one time step at a time.
Abstract method that sets up the projection's output structure.
Convenience method that writes output for
projection entitymembers.Details
- __init__(projection_parameters: ProjectionParameters, data_sources: DataSourcesRoot)¶
Constructor method. Sets the starting time step and declares projection entities. Override this method to declare additional projection entities.
- Parameters:
projection_parameters – Set of projection parameters.
data_sources – Data sources to be read at runtime.
- data_sources: DataSourcesRoot¶
Data sources to be read at runtime.
- halt_projection() bool¶
By default, evaluating this method can trigger a halt in the
main projection loop. Override this method to define custom halt logic. For example, halting when the policy count reaches zero.The default behavior is to never halt the projection.
- Returns:
Boolean to indicate whether the projection should be halted.
- output_dir_path: str¶
Output directory path to place projection output.
- abstract project_time_step() None¶
Abstract method that is called every time step. Its purpose is to define a calculation order within a single time step by calling methods from various
projection entities. Override this method to define what occurs within a single time step.- Returns:
Nothing.
- projection_parameters: ProjectionParameters¶
Projection parameters.
- run_projection() None¶
Runs the main projection loop, projecting forward one time step at a time. Override this method to create a custom projection loop.
- Returns:
Nothing.
- abstract setup_output() None¶
Abstract method that sets up the projection’s output structure. Method is called serially for each projection before the projection starts running to avoid race conditions in parallel projection run setups.
- Returns:
Nothing.
- write_output() None¶
Convenience method that writes output for
projection entitymembers. Note that this function behaves recursively, and will write output for nested projection entity members as well.- Returns:
Nothing.