Expand description

This module contains types related to handling and processing metrics during railway simulations.

Metrics handlers are used to process and collect metrics from simulation events. The module provides a MetricsHandler trait that defines the interface for handling simulation events and extracting metric values.

The ActionCountHandler and TargetReachedHandler structs are provided as example implementations of metrics handlers. ActionCountHandler counts the number of RailMovableAction events, while TargetReachedHandler counts the number of target reached events during the simulation.

Handlers can be registered with the Simulation struct to process events during the simulation execution.

Structs

  • ActionCountHandler is a metrics handler that counts the number of actions performed by railway objects in a simulation.
  • A metrics handler that counts the number of times the target has been reached.

Traits

  • The MetricsHandler trait defines the interface for handling simulation events and extracting metric values.