Tool · scenario data only

Scenario Builder

Place points of injury, bases, and treatment facilities, give each base its assets, then export the scenario as JSON. The file describes the scenario only: where things are, how casualties appear, and what each asset can do. It holds no dispatch rules. A greedy dispatcher, a MIP, a simulation, or an MDP reads the same file and builds its own decisions or state from it.

  • POI (U/P/R counts, or λ for stochastic arrival)
  • Base (helicopter / ground vehicle count)
  • Treatment facility (role of care R1 / R2 / R3)

Coordinates in km. Origin (0, 0) is bottom-left. Drag to move. Arrow keys nudge the selection by 1 (Shift: 10). Delete removes it.

Export preview

This is the file Export writes. It updates as you edit. Continuous values (coordinates, sizes, horizon, rates, speeds, probabilities) are written with a decimal point. Counts and capacities are written as integers.

Reading the file in Julia

using JSON3

s = JSON3.read(read("scenario_01.json", String))

H      = Float64(s.scenario.planning_horizon_min)          # minutes
pos    = Dict(String(o.id) => (Float64(o.x), Float64(o.y))  # km
              for list in (s.pois, s.bases, s.treatment_facilities) for o in list)
assets = Dict(String(a.id) => a for a in s.assets)          # type, home_base, capacity, speed_kmh, initial_status
seed   = hasproperty(s.scenario, :random_seed) ? Int(s.scenario.random_seed) : nothing
# Each facility may optionally provide `capacity` (casualties); the model defines its use.

# Casualty generation is set per POI.
for p in s.pois
    g = p.casualty_generation
    if g.mode == "fixed"            # known casualties at t = 0
        n = g.casualties_by_precedence          # n.urgent, n.priority, n.routine (Int)
    else                            # "stochastic": Poisson arrivals
        λ = Float64(g.rate_per_hr)              # casualties per hour
        P = g.precedence_probabilities          # P.urgent + P.priority + P.routine == 1
    end
end

# Travel time is derived by the model, not stored in the file:
dist(a, b)        = hypot(pos[a][1] - pos[b][1], pos[a][2] - pos[b][2])   # km, straight line
travel_min(k, a, b) = 60 * dist(a, b) / Float64(assets[k].speed_kmh)

Top-level keys: schema_version, scenario, workspace, pois, bases, treatment_facilities, assets. scenario.random_seed and treatment_facilities[].capacity are optional nonnegative/positive integer inputs for stochastic sampling and facility limits respectively; models define their operational use. JSON3 reads 25.0 as Int64, so convert continuous fields with Float64.

A reference reader that runs a simple greedy dispatch against an exported file is in tests/scenario_builder/greedy_smoke.jl. Its dispatch rule is in the Julia code, not in the JSON.