#[non_exhaustive]pub struct Metrics { /* private fields */ }Expand description
Aggregated simulation metrics, updated each tick from events.
Games query this via sim.metrics() for HUD display, scoring,
or scenario evaluation.
Implementations§
Source§impl Metrics
impl Metrics
Sourcepub const fn with_throughput_window(self, window_ticks: u64) -> Self
pub const fn with_throughput_window(self, window_ticks: u64) -> Self
Set the throughput window size (builder pattern).
Sourcepub const fn avg_wait_time(&self) -> f64
pub const fn avg_wait_time(&self) -> f64
Average wait time in ticks (spawn to board).
Sourcepub const fn avg_ride_time(&self) -> f64
pub const fn avg_ride_time(&self) -> f64
Average ride time in ticks (board to exit).
Sourcepub const fn max_wait_time(&self) -> u64
pub const fn max_wait_time(&self) -> u64
Maximum wait time observed (ticks).
Sourcepub const fn throughput(&self) -> u64
pub const fn throughput(&self) -> u64
Riders delivered in the current throughput window.
Sourcepub const fn total_delivered(&self) -> u64
pub const fn total_delivered(&self) -> u64
Riders delivered total.
Sourcepub const fn total_abandoned(&self) -> u64
pub const fn total_abandoned(&self) -> u64
Riders who abandoned.
Sourcepub const fn total_spawned(&self) -> u64
pub const fn total_spawned(&self) -> u64
Total riders spawned.
Sourcepub const fn abandonment_rate(&self) -> f64
pub const fn abandonment_rate(&self) -> f64
Abandonment rate (0.0 - 1.0).
Sourcepub const fn total_distance(&self) -> f64
pub const fn total_distance(&self) -> f64
Total distance traveled by all elevators.
Sourcepub const fn utilization_by_group(&self) -> &HashMap<String, f64>
pub const fn utilization_by_group(&self) -> &HashMap<String, f64>
Per-group instantaneous elevator utilization (fraction of elevators moving).
Sourcepub const fn reposition_distance(&self) -> f64
pub const fn reposition_distance(&self) -> f64
Total distance traveled by elevators while repositioning.
Sourcepub const fn total_moves(&self) -> u64
pub const fn total_moves(&self) -> u64
Total rounded-floor transitions across all elevators (passing-floor crossings plus arrivals).
Sourcepub const fn total_settled(&self) -> u64
pub const fn total_settled(&self) -> u64
Total riders settled as residents.
Sourcepub const fn total_rerouted(&self) -> u64
pub const fn total_rerouted(&self) -> u64
Total riders rerouted from resident phase.
Sourcepub const fn throughput_window_ticks(&self) -> u64
pub const fn throughput_window_ticks(&self) -> u64
Window size for throughput calculation (ticks).
Sourcepub const fn total_energy_consumed(&self) -> f64
pub const fn total_energy_consumed(&self) -> f64
Total energy consumed by all elevators (requires energy feature).
Sourcepub const fn total_energy_regenerated(&self) -> f64
pub const fn total_energy_regenerated(&self) -> f64
Total energy regenerated by all elevators (requires energy feature).
Sourcepub const fn net_energy(&self) -> f64
pub const fn net_energy(&self) -> f64
Net energy: consumed minus regenerated (requires energy feature).
Sourcepub fn avg_utilization(&self) -> f64
pub fn avg_utilization(&self) -> f64
Overall utilization: average across all groups.