GenericTracer¶
- class passengersim.tracers.generic.GenericTracer[source]¶
Bases:
ABCBase class for tracers that collect detail while a simulation runs.
Subclasses that can be enabled from a configuration declare, beside their constructor, everything a configured-callback registration needs:
name,hook,options_model, andoptions_version. Thenpassengersim.callbacks.register_tracer_factory()registers the class without restating any of them.Methods
__init__()attach(sim)Attach this tracer to a Simulation, which will be traced as it runs.
finalize()Convert the internal counters on this tracer to a dataframe.
fresh()Return a fresh copy of this tracer, tracing the same targets but not sharing state.
reset()Reset the internal counters on this tracer to a null state.
Attributes
Canonical result key in
callback_data.Pydantic model of the constructor's keyword options, for configured callbacks.
Configured-callback implementation version; bump when results change meaning.
Lifecycle hook at which the tracer runs, for manual and configured attachment.
-
name : str =
'generic_tracer'¶ Canonical result key in
callback_data.
- hook : ClassVar[Literal['initialize_sample', 'begin_sample', 'daily', 'end_sample', 'finalize_sample']]¶
Lifecycle hook at which the tracer runs, for manual and configured attachment.
-
options_model : ClassVar[type[BaseModel] | None] =
None¶ Pydantic model of the constructor’s keyword options, for configured callbacks.
Its fields and defaults must match the constructor’s arguments.
-
options_version : ClassVar[str] =
'1'¶ Configured-callback implementation version; bump when results change meaning.
- abstractmethod fresh() GenericTracer[source]¶
Return a fresh copy of this tracer, tracing the same targets but not sharing state.
- abstractmethod attach(sim: Simulation) None[source]¶
Attach this tracer to a Simulation, which will be traced as it runs.
-
name : str =