Skip to content

Implement KPI calculation #96

@wklumpen

Description

@wklumpen

Description

Calculate performance metrics from simulation results.

Epic

🟢 API Foundation (Weeks 1-2)

Tasks

  • Create calculate_metrics() method in Model
  • Calculate average delay by corridor
  • Calculate on-time percentage (e.g., within 2 minutes)
  • Calculate headway statistics (mean, min, max, std)
  • Calculate dwell time statistics by station
  • Detect conflicts/near-misses (optional for MVP)
  • Include metrics in Model.results dictionary

Acceptance Criteria

  • Metrics calculated automatically after simulation completes
  • All KPIs present in results
  • Broken down by corridor/station where relevant
  • Calculations are correct (validate against manual calculation)

Time Estimate

3 hours

Dependencies

Files Changed

  • spur/model.py

Testing

Run simulation and manually verify metric calculations.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions