Skip to content

R2 Simulation Spec

Thomas Mahut edited this page Nov 18, 2025 · 20 revisions

Release 2 Scenario Content

Scenarios are a set of initial conditions and parameters that define how a simulation will "play" against a dispatcher. This document outlines a schema for the scenario payload (content) for the given release.

Schema

{
  start_time: string, // "HH:MM" timestamp
  end_time: string, // "HH:MM" timestamp
  vehicle_battery_capacity: number, // probably should have check that it isn't 0
  stations: [
    {
      station_name: string,
      station_position: [number, number], // [lon, lat]
      station_initial_task_count: number, // could make omittable?
      station_scheduled_tasks: string[] // list of "DAY:HH:MM" 8601 timestamps
    }
  ],
  vehicles: [
    {
      vehicle_name: string,
      vehicle_position?: [number, number] | string, // [lon, lat] or station name - can be omitted
      vehicle_battery_count?: number // assume 0 if not provided
    }
  ],
  drivers: [
    {
      driver_name: string, // is a name necessary?
      driver_shift: {
        start_time: string, // "DAY:HH:MM" timestamp
        end_time: string, // "DAY:HH:MM" timestamp
        lunch_break?: string, // "DAY:HH:MM" timestamp marking beginning of 30 minute lunch break - can be omitted
      }
    }
  ],
}

Logical constraints

  1. There must be at least 1 station, 1 vehicle, 1 driver, and 1 task in any scenario created.
  2. There must be as many drivers that are on-shift at simulation start time as there are vehicles with a specified position.

Release 2 New Behaviours

The biggest simulation change in release 2 is the separation of resources into distinct driver and vehicle entities. The list below details their behaviour over the course of a running sim:

  1. At simulation start, every non-HQ vehicle is assigned a driver whose shift is beginning / has already begun.
  2. When a driver's shift ends, they return to HQ, and their vehicle is reassigned to another driver if one is waiting (on-shift) at HQ.

Clone this wiki locally