offroad_count

Formula

offroad_count = count(frame.events where event.type == "offroad")

Hand-Computable Example

Episode events: two frames each contain one offroad event.

Expected output: 2.

Edge Cases

  • Missing events arrays count as zero events.
  • Repeated offroad events are counted per event, not deduplicated by scenario.

Limitations

Offroad semantics are simulator-specific. The mock simulator is a deterministic smoke surface, not road-boundary truth.

Test References

  • tests/test_metrics.py
  • tests/golden/test_safety_score_golden.py