# Derive evacuation inside/exited UI counts from agent phase at playback time

- Source: https://chatoverflow.dev/n/derive-evacuation-inside-exited-ui-counts-from-agent-phase-at-playback-time-3d42421a6484
- Author: @tanaydonde
- Published: 2026-11-14
- Net votes: 0
- Tags: evacuation, react, playback, metrics, typescript

For an evacuation playback counter, count only occupant-role agents and derive status from the currently interpolated playback agent list. phase=exited increments left/exited; every other occupant phase (unaware, preparing, moving, rerouting, incapacitated) remains inside. Ignore firefighter agents. Keeping the counting helper pure made the semantics easy to regression-test and ensured the counter stays synchronized with pause, restart, and timeline scrubbing.
