IMO Test 11 — Congestion and flow on stairs¶

Definition¶

A population of 150 occupants evacuates from a room through a narrow corridor and an upward staircase. Congestion is expected at the room exit and staircase base, while flow through the corridor should be approximately steady.

Source: IMO MSC.1/Circ.1533, Annex 3, Test 11.

JuPedSim represents the staircase as a planar region in which desired walking speeds are reduced by 50%. The numerical acceptance thresholds used below are project-defined operationalizations of the qualitative IMO criterion.

In [1]:
from datetime import datetime, timezone

print(datetime.now(timezone.utc).isoformat())
2026-12-01T15:30:35.657862+00:00
In [2]:
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from matplotlib.patches import Rectangle

from scenario_builders.imo11_staircase import (
    build_imo11_staircase,
    run_imo11_staircase,
    check_imo11_congestion_and_flow,
)
In [3]:
plt.rcParams.update({
    "figure.facecolor": "white",
    "axes.facecolor": "#f7f7f5",
    "axes.spines.top": False,
    "axes.spines.right": False,
    "font.size": 11,
    "figure.dpi": 120,
})

Scenario¶

The room measures 8 × 6 m, the corridor 2 × 12 m, and the planar staircase approximation 2 × 4 m. The initial population consists of 150 occupants.

The scenario is constructed using the same builder as the corresponding pytest verification test.

In [4]:
simulation = build_imo11_staircase(seed=42)
initial_count = simulation.agent_count()
positions = np.array([
    agent.position for agent in simulation.agents()
])

print(f"Initial population: {initial_count}")
Initial population: 150
In [5]:
fig, ax = plt.subplots(figsize=(6, 9))

geometry = simulation.get_geometry()
boundary = np.asarray(geometry.boundary(), dtype=float)
ax.plot(boundary[:, 0], boundary[:, 1], color="black")

ax.scatter(
    positions[:, 0], positions[:, 1],
    s=8, alpha=0.7, label="Initial occupants",
)

regions = {
    "Room exit": (3, 5.5, 2, 2),
    "Corridor": (3, 10, 2, 2),
    "Stair base": (3, 17, 2, 2),
}

for label, (x, y, w, h) in regions.items():
    ax.add_patch(Rectangle(
        (x, y), w, h,
        facecolor="tab:orange",
        edgecolor="tab:orange",
        alpha=0.25,
    ))
    ax.text(x + w + 0.3, y + h / 2, label, va="center")

ax.add_patch(Rectangle(
    (3, 18), 2, 4,
    facecolor="tab:purple", alpha=0.15,
    label="Reduced-speed staircase",
))

ax.add_patch(Rectangle(
    (3.2, 21.7), 1.6, 0.25,
    facecolor="tab:green", label="Exit",
))

ax.axhline(
    12, xmin=0, xmax=1,
    color="tab:red", linestyle=":",
    label="Flow measurement height",
)

ax.set(
    xlabel="x [m]", ylabel="y [m]",
    title="IMO 11 — Initial configuration",
    aspect="equal", xlim=(-0.5, 9), ylim=(-0.5, 23),
)
ax.legend(loc="upper center", bbox_to_anchor=(0.5, -0.08))
plt.tight_layout()
plt.show()
No description has been provided for this image

Simulation¶

The simulation uses a timestep of 0.05 s and a maximum duration of 300 s. Trajectories are recorded using the shared simulation runner.

In [6]:
trajectories, evacuation_time = run_imo11_staircase(
    simulation, dt=0.05, max_time=300.0,
)

print(f"Evacuation time: {evacuation_time:.2f} s")
print(f"Remaining occupants: {simulation.agent_count()}")
print(f"Recorded positions: {len(trajectories)}")
Evacuation time: 80.90 s
Remaining occupants: 0
Recorded positions: 148266

Results¶

Congestion is evaluated using local pedestrian densities and walking speeds. Corridor flow is measured in consecutive 10-second intervals.

In [7]:
regions = {
    "Room exit": (3, 5, 5.5, 7.5),
    "Corridor": (3, 5, 10, 12),
    "Stair base": (3, 5, 17, 19),
}

times = np.sort(trajectories["time"].unique())

fig, axes = plt.subplots(1, 2, figsize=(12, 4))

for label, (x0, x1, y0, y1) in regions.items():
    inside = trajectories[
        (trajectories.x >= x0)
        & (trajectories.x < x1)
        & (trajectories.y >= y0)
        & (trajectories.y < y1)
    ]

    density = (
        inside.groupby("time").size()
        .reindex(times, fill_value=0)
        / ((x1 - x0) * (y1 - y0))
    )

    axes[0].plot(
        times,
        density.rolling(20, min_periods=1).mean(),
        label=label,
    )

axes[0].axvspan(
    10, 50, color="grey", alpha=0.1,
    label="Density evaluation period",
)
axes[0].set(
    xlabel="Time [s]",
    ylabel="Density [persons/m²]",
    title="Local pedestrian density",
)
axes[0].legend()

ordered = trajectories.sort_values(["id", "time"])
previous_y = ordered.groupby("id")["y"].shift(1)
crossings = ordered.loc[
    (previous_y < 12) & (ordered.y >= 12), "time"
]

bins = np.arange(0, 301, 10)
counts, _ = np.histogram(crossings, bins=bins)

axes[1].bar(
    bins[:-1], counts / 10,
    width=9, align="edge",
)
axes[1].axvspan(10, 60, color="grey", alpha=0.15)
axes[1].set(
    xlabel="Time [s]",
    ylabel="Flow [persons/s]",
    title="Corridor flow",
    xlim=(0, max(80, crossings.max() + 10)),
)

plt.tight_layout()
plt.show()
No description has been provided for this image

Acceptance criteria¶

  • All 150 occupants evacuate within 300 s.
  • All occupants cross the corridor midpoint.
  • Mean densities at the room exit and staircase base exceed the corridor density during 10–50 s.
  • Walking speeds at the room exit and staircase approach are below 85% of corridor speed.
  • Corridor flow has a coefficient of variation below 0.15 during 10–60 s.

The congestion and flow checks use the same function as pytest.

In [8]:
assert initial_count == 150
assert not trajectories.empty
assert simulation.agent_count() == 0

metrics = check_imo11_congestion_and_flow(trajectories)

print("\nAll acceptance criteria passed.")
Density over time (10-second intervals):
  room_exit    |  0–10 s | 2.18 persons/m²
  room_exit    | 10–20 s | 2.64 persons/m²
  room_exit    | 20–30 s | 2.65 persons/m²
  room_exit    | 30–40 s | 2.59 persons/m²
  room_exit    | 40–50 s | 2.49 persons/m²
  room_exit    | 50–60 s | 0.37 persons/m²
  room_exit    | 60–70 s | 0.00 persons/m²
  room_exit    | 70–80 s | 0.00 persons/m²
  corridor     |  0–10 s | 0.60 persons/m²
  corridor     | 10–20 s | 1.47 persons/m²
  corridor     | 20–30 s | 1.59 persons/m²
  corridor     | 30–40 s | 1.84 persons/m²
  corridor     | 40–50 s | 2.07 persons/m²
  corridor     | 50–60 s | 1.96 persons/m²
  corridor     | 60–70 s | 0.03 persons/m²
  corridor     | 70–80 s | 0.00 persons/m²
  stair_base   |  0–10 s | 0.00 persons/m²
  stair_base   | 10–20 s | 1.38 persons/m²
  stair_base   | 20–30 s | 2.32 persons/m²
  stair_base   | 30–40 s | 2.44 persons/m²
  stair_base   | 40–50 s | 2.42 persons/m²
  stair_base   | 50–60 s | 2.43 persons/m²
  stair_base   | 60–70 s | 2.43 persons/m²
  stair_base   | 70–80 s | 0.57 persons/m²

Mean walking speeds (20–50 s):
  room_exit   : 0.566 m/s
  corridor    : 0.764 m/s
  stair_base  : 0.527 m/s

Staircase approach (before speed reduction):
  Mean speed: 0.546 m/s
  Corridor mean speed: 0.764 m/s
  Speed ratio: 0.714

Corridor flow by 10-second interval:
    0– 10 s: 1.10 persons/s
   10– 20 s: 2.90 persons/s
   20– 30 s: 2.80 persons/s
   30– 40 s: 2.80 persons/s
   40– 50 s: 2.60 persons/s
   50– 60 s: 2.60 persons/s
   60– 70 s: 0.20 persons/s

IMO 11 measurements:
  room_exit: 2.592 persons/m²
  corridor: 1.743 persons/m²
  stair_base: 2.142 persons/m²
  Total corridor crossings: 150
  Maximum 10-second flow: 2.90 persons/s
  Mean steady flow: 2.74 persons/s
  Flow coefficient of variation: 0.044

All acceptance criteria passed.