TRAFFIC SIM LAB — VERSION 1.5
Created 2 November 2026 for James Lyons-Weiler

PURPOSE
Compare queue waiting, complete trip time, and approximate gasoline use for a
conventional four-way intersection and a median-U-turn (Michigan-left) design.
This is an exploratory mesoscopic point-queue model, not a calibrated traffic
engineering forecast, validated fuel model, or physical collision simulator.

DESIGNS AND ROUTES
East-west is the arterial. Both layouts have one through/right lane per approach.
The conventional default shares that lane with permissive left-turn vehicles;
an optional dedicated left-turn pocket isolates those vehicles. That alternative
adds pavement/lane storage; the experiment does not hold land area constant.
Michigan-left vehicles have dedicated U-turn queues in the east-west median.
Arterial left: straight at main light -> downstream U-turn -> return right.
Cross-street left: right at main light -> downstream U-turn -> return straight.
All left movements retain their original origin and destination.
Both endpoints are 600 m from the main intersection. The conventional route is
idealized as 1,200 m regardless of movement. The Michigan left adds 2d + 30 m,
where d is the center-to-crossover distance. Curved centerline differences at
the main intersection are not separately resolved. Default d = 660 ft = 201.168 m.
The arterial carries one traffic lane per direction; real Michigan-left roads
often have more lanes and different lane-changing and storage requirements.

TRAFFIC AND SIGNALS
Default demand: 400 vehicles/hour/approach on each axis (1,600 total expected).
Movement probabilities on every approach: 20% left, 10% right, 70% through.
For each approach, entry headways are 2 seconds plus an exponential variate,
with its mean chosen to preserve the requested mean demand. The first arrival
uses an exponential wait. This is a shifted-exponential renewal model, not a
pure Poisson process. Independent approaches use successive values from one
seeded pseudorandom stream. Both layouts reuse exactly the same demand list.

Default main cycle: EW green 40 s -> yellow 3 s -> all-red 2 s -> NS green
40 s -> yellow 3 s -> all-red 2 s. Green split and cycle are adjustable and
are held equal between the two designs. There are no protected left arrows,
pedestrian phases or actuated extensions. Right-on-red is optional (off by default).
Normal discharges have 2 s headway and begin after a 2 s startup allowance.
Conventional lefts seek a 5.5 s future gap, with at least 2 s since an opposing
departure. Future opposing movements are estimated from the lane's queue and
scheduled arrivals. Opposing queued left turns are compatible and may release
simultaneously; a 3 s reservation holds conflicting following through vehicles.
As a configurable approximation, one left that arrived before the end of green
may clear at 2 s into yellow. No new through/right cars enter on yellow.
U-turns seek a 7 s future gap and at least 2 s since the last opposing arterial
entry-stream passage. U-turn follow-up headway is 3 s. Yield control is the default. Version 1.3 adds signalized crossovers,
with matching cycle/split and configurable crossover-minus-main offset.
The -7 s preset reproduces an example in FHWA-HRT-09-060 chapter 3:
arterial green at the crossover starts/ends 7 s before the main green.
This is a historical illustrative setting, not universal or optimized.
All major-road entrants encounter the upstream crossover signal. Its
wait and restart fuel are charged; left-turn trips also encounter the
U-turn signal and return main light. Optional crossover left-on-red
requires a full stop and an arterial gap. Optional right-on-red applies
to both layouts, including first and return Michigan visits. Only a
head-of-queue right turn can use it. Both red-turn settings default off.
Red turns reserve conflicting merges; no pedestrians are represented.
For conservatism, crossover left-on-red is attempted only during the
arterial green, not its yellow or intergreen. Local prohibitions and
visibility must be checked before interpreting a real site.
See intersection-lab/methods.html#coordination for primary sources.
All critical gaps and yellow-clearance behavior are uncalibrated assumptions.

MODEL RESOLUTION
The default step is 0.5 s. Queue-arrival and subsequent road-travel times are
continuous; service is rounded to the next eligible tick. Thus rounding adds
up to a tick per service. See validation.json for a 0.25 s sensitivity check.
Vehicles are point objects; their queues have no physical occupancy constraints.
Queue sampling is every 10 s. Storage warning thresholds use 7.5 m per queued
vehicle, the 600 m boundary for standard and minor approaches, d for Michigan
arterial approaches, and 10 cars for a nominal 250 ft U-turn bay. These are
diagnostic flags only, not storage constraints. They do not alter service.
Combining through and pocket queues for storage warning is conservative.

RUN DESIGN AND REPLICATION
10 min warmup; 60 min measured entry window; 10 min subsequent background
arrivals. Stop arrivals, then allow up to 120 additional minutes to release
remaining vehicles. Measured entrants are followed to their modeled exit.
Queue-delay and fuel averages include complete trips for that same cohort.
Unfinished trips are reported explicitly; means are censored if any remain.
The end of background demand can influence extreme-congestion drain results,
so these are finite-demand experiments, not steady-state capacity estimates.
The default comparison uses 20 paired replications, adjustable to any integer
from 1 to 1,000 in the UI: seed 271828 + i*7919, i=0..n-1.
This controls independent paired runs, not the number of vehicles per run. The UI
reports actual entrant counts per run and summed across runs for each layout.
Means are averages of per-replication means; replicate sizes may differ.
Reported differences are Michigan minus standard within each replication.
95% intervals use Student-t (df=n-1) across paired differences. With one run,
the interval is unavailable (exported half=null), not zero-width. Critical values
use a numerical reference table through df=30 and a fourth-order Cornish-Fisher
expansion above that; max absolute error <1e-7 against SciPy for df=1..999.
These intervals quantify Monte Carlo variation only, not calibration uncertainty.
The percentile wait metric is the mean of each replication's empirical 95th
percentile, not a pooled percentile. The chosen number of replications is run when Run paired comparison is pressed.

TIME AND FUEL
Queue wait = sum(service time - free-flow node arrival time) across each visit.
It is a point-queue residence estimate, not observed engine-idling seconds from
a microscopic trajectory. A wait >= 1 s is counted as one stop at that node.
Time spent moving slowly is separate from queue wait.
Default cruise speed: 35 mph; main-turn segment: 20 m at 8 m/s; U arc: 30 m
at 5 m/s. Turn speeds are capped at cruise speed when necessary.
For each stop or slowing maneuver, add an approximate loss relative to cruise:
  loss seconds = (v - v_min)^2 / (2v) * (1/a + 1/b)
with a=1.5 m/s^2, b=2 m/s^2. v_min=0 for a queued stop, turn speed for an
unimpeded turn, cruise speed for unimpeded through. These losses are lumped
into downstream travel after the point service; they are not a physical motion
integration or a guarantee of collision-free trajectories.

Fuel gallons = distance miles / steady-speed mpg
             + queue seconds / 3600 * idle gallons per hour
             + sum[0.5 * mass * (v^2-v_min^2)] / (efficiency * joules per gallon)

Defaults: 30 steady-speed mpg, 0.25 US gal/hour idle, 1,600 kg mass, 25%
fuel-to-wheel efficiency, and 121 MJ/US gal fuel lower heating value. This is
a transparent approximation. It must not be interpreted as an EPA/MOVES or
VT-Micro fuel estimate. Using combined city/highway mpg here would partly
double-count stop/acceleration losses. Idling while moving, auxiliary loads,
cold starts, gear shifts, regenerative braking, hybrids, EVs, stop-start,
vehicle mix and load variation are not represented. Constant-speed fuel cost
uses the same mpg on all segments; true fuel use varies with speed and load.
Fuel sensitivity to mpg, idle rate, mass and efficiency should be assessed
before drawing conclusions. Smaller average wait does not imply less fuel.

FUEL AUDIT ADDED IN v1.1
The original total-fuel model already charged outbound/return detour distance,
the U-turn arc, and separate idling and acceleration at every visited node.
v1.1 exposes this ledger without changing the default physical model or mean
results. The additive left-turn breakdown contains:
  base 1,200 m route; outbound detour d; return detour d; U arc length;
  first-main, U-turn, and return-main idling;
  first-main, U-turn, and return-main restarts;
  recovery after rolling turns (all nodes combined).
A restart means acceleration from a modeled standstill, not turning an engine
back on. It is charged only for node waits >=1 s. If a car rolls through instead,
its turn-speed recovery is recorded in rollingRecovery, not also as a restart.
A vehicle stopping at both the U-turn and the return signal receives two separate
restart charges, plus both waits. A first-intersection stop adds a third charge. The point-queue model counts at
most one full stop per node visit; repeated creeping/restarting within a single
queue is not modeled.
Node classifications, waits, stopped flags, and energy are retained in vehicle
records. The export includes leftFuelAudit in gallons per completed left-turn
trip; the UI multiplies these values by 1,000 for readability.
Stop percentages average per-run fractions among completed Michigan-left trips.
The joint double-stop fraction is measured directly, not a product of marginal
fractions. A separate diagnostic identifies a return stop whose arrival phase
was non-green (including yellow); return stops can also arise from queues on green.
If no left-turn trips complete, the ledger and stop rates display as unavailable.
The detour-distance sentence remains a geometry calculation, not an observation.

ANIMATION AND LIVE COUNTERS
The animation replays exact node arrival/service events from replication 1.
It shares vehicle IDs, route choices and one clock across the two layouts.
The drawing is schematic: road lengths are compressed, queue points are spread
into visible cars, and crossing/road motion is interpolated. These trajectories
are not used to calculate the model outputs. Queue positions can change abruptly;
apparent overlaps are drawing artifacts, not modeled collisions. Cars beyond the
drawing bounds may be clipped; live queue totals still count all queued cars.
Gold cars intend a left turn; silver cars intend through/right. Background
vehicles are faint. Queue totals include background; live wait and fuel include
only the observation-period entrants seen so far. Live mean wait divides accrued
wait by entered vehicles, including incomplete trips, so it differs from the final
full-cohort mean until all measured trips finish.
Live distance fuel interpolates route progress between recorded events. Acceleration
fuel is added when a node is released. Final full-trip values match the engine.
Pause, replay, speed, timeline scrubbing and driver selection change playback only.

KNOWN LIMITS / NEXT EXTENSIONS
No finite storage or blocked-back traffic; no lane changing, merging behavior,
platoon propagation from other signals, pedestrian/right-turn conflicts, truck
mix, weather, safety analysis, network routing or adaptive control. The shared
lane/pocket choice can change which design wins. U-turn signaling and coordination
are modeled as optional approximations in v1.3 onward; they require calibration.
Timing optimization should be symmetric: compare equal timings first, then optimize
each design under the same objective and constraints. The current UI uses equal timing.

VALIDATION / REPRODUCTION
Requires Node.js for command-line reproduction; browser UI has no build dependency.
  node tests.cjs
  node run-study.cjs
Run-study writes the baseline, pocket-lane comparison, time-step sensitivity,
and a volume/left-share sweep to analysis/*.json and analysis/sweep.csv.
Checks include deterministic repeated seeds, identical demand, zero-left exact
equivalence, route/event accounting, nonnegative waits, complete-trip fuel sums,
fuel parameter response and all measured trips retained.

PRIMARY SOURCES (accessed 2 November 2026)
FHWA, Synthesis of the Median U-Turn Intersection Treatment, FHWA-HRT-07-033.
Routing and MDOT's reported 660 ft +/-100 ft crossover spacing.
https://www.fhwa.dot.gov/publications/research/safety/07033/

FHWA, Traffic Signal Timing Manual, Chapter 3, FHWA-HOP-08-024.
Simple 1,800 veh/h/lane saturation-flow and 2 s startup approximations.
https://ops.fhwa.dot.gov/publications/fhwahop08024/chapter3.htm

Oak Ridge National Laboratory, ORNL/TM-2016/224, supporting information p.28.
Selected passenger gasoline vehicles idle at 0.16 and 0.39 gal/h without load;
these illustrate variation, not a validated fleet-average 0.25 gal/h.
https://info.ornl.gov/sites/publications/Files/Pub67767.pdf

US DOE, Alternative Fuels Data Center, Fuel Properties Comparison.
Gasoline lower heating value roughly 112,114-116,090 Btu/US gallon.
https://afdc.energy.gov/fuels/properties

CRASH PROCESSES ADDED IN v1.2 — 3 NOVEMBER 2026
See crash-evidence.html for source tables, boundaries and limitations.
The default reference inputs are FHWA-HRT-07-033 Tables 3-4 (2007), not a
current statewide forecast. Intersection-related all-crash rates are 1.644
standard / 1.388 Michigan per million entering vehicles. Published all-crash
shares are retained as weights and normalized for rounding. Do not infer
severity from the legacy table: its severity totals do not fully reconcile.
The geographic scope is insufficiently explicit to calibrate our system.
A 2025 study of 264 Michigan crossover segments (132 sites; 2019-2023)
provides contextual evidence, but excludes the central intersection and uses
mixed crossover controls. Its listed crash types leave 691/7,523 unaccounted
for; these are not assigned invented types. That mix is not spliced into our
historical comparison. Modern signalized and unsignalized results are kept
separate; no universal reduction or statewide prevalence is asserted.

crashes.js exposes settings, plan, simulate and summarize. C.simulate first
runs the traffic model without incidents, retaining node events. It samples
Poisson counts with lambda = reference rate * unique observation entrants /
1e6, multiplied by 1,000 only in explicit demonstration mode. RNG is separate
from demand and independent across layouts. Count, type and placement draws
are deterministic given parameters and seed. Total rates and type shares are
inputs and do not respond to speed, gap, spacing, left share or congestion.
An absent eligible movement does not make its published reference risk zero.
Instead, an incident is placed externally on a main approach and flagged.

Types follow the historical table; current UD-10 categories are explained
separately. Scenario placement is assumed, not inferred from crash narratives.
Rear-end nodes are weighted by time queued in the crash-free run. Turn types
favor corresponding L/U or R nodes; main straight-angle events favor through
nodes; same-direction Michigan sideswipes favor U-turn merge nodes. Michigan
head-on-left residuals have no permitted direct-left path and are explicitly
external access/violation scenarios. No claim is made that a legal U-turn
would carry that UD-10 code. Other incident types use generic node proxies.
If no suitable completed node exists, use a labeled external approach event.
The first crash-free pass fixes placements; they are not reallocated after
closures. Schematic icons depict external incident actors, not tracked vehicle
IDs whose collisions are physically calculated.

Crash events block resources for a user-assumed duration (default 120 s,
range 0-1800 s, all types equal). At the main junction, angle/head-on/direct-left
scenarios block all main and left queues; other scenarios block the affected
queue. At a U-turn, only that U-turn queue is blocked (no opposing through-lane
obstruction). Overlapping closure intervals are merged. The same traffic is
then simulated again. Discharge is prevented on [start,end), including yellow
left releases. No vehicles are removed; all entrants still contribute to time
and fuel accounting. Clearance time has no calibrated severity relationship.
Fuel changes follow the existing node-wait and conditional restart accounting.
A 0-second clearance retains event counts/markers with no traffic effects.

Expected counts at the unamplified input rate and sampled scenario counts are
reported separately. Crash-closure effects compare each run with the same seed
and demand without closures. All principal traffic metrics include closures
when enabled. Demonstration-mode traffic outputs are not real-world forecasts.
Only the first paired run is animated. All runs contribute to aggregate counts
and traffic statistics. Full event logs for that first pair are in JSON export;
by-type counts and probabilities for every run are summarized. Turning off the
layer leaves all original results unchanged. Warmup/tail incidents, physical
vehicle impacts, response operations, vehicle removal, secondary crashes,
injuries, actual lane changes, and physical spillback remain unmodeled. Rates
cannot be statistically validated by simulated counts generated from those
same input rates. Interval estimates exclude calibration/model uncertainty.

VALIDATION
node tests.cjs: original demand, route, time/fuel, sample-size and CI checks.
node crash-tests.cjs: Poisson means, deterministic independent crash streams,
demand identity, off/zero-rate/zero-duration equivalence, actual closure service
exclusion (including overlapping closures and yellow/pocket service), completed
cohort fuel/time conservation, absent-movement flags and pooled exposure counts.
analysis/crash-validation.json contains reproducible verification scenarios.

CRASH SUMMARY AND REPLAY CHARTS (v1.3)
The five display groups partition all 11 detailed crash categories exactly
once: rear/rear-left/rear-right; opposing direct-left; angle/angle-turn;
sideswipe same/opposite; head-on/fixed-object/overturn. Solid bars show
expected counts pooled over all runs; white diamond markers show the
sampled count. Applied frequency uses input expectation times multiplier
(or zero when disabled); base rate always shows the unmultiplied input
expectation. A 1,000x marker and 1x bar are explicitly flagged as unmatched.
Live incident curves and colored counters use only run 1. Each event is
counted once when start <= replay time. Cleared events stay counted; rewind
recomputes counts from the event list. Solid lines are Standard and dashed
lines Michigan. These are sampled external events, not collisions detected
from vehicle drawings. Queue curves include background traffic, upstream
crossover signals and drain time, sampled every 10 seconds.


ANNUAL COST SCENARIOS (v1.4)
See annual-methods.html for the source audit and full accounting definitions.
The user's preliminary assumptions are 550M intended Michigan-left maneuvers
annually (200M-1.1B sensitivity), 1,000 individual crossover openings, and
12B all-left maneuvers. These are not verified statewide counts. Rounded
central inputs imply 4.58% of actual turns. Each intended maneuver counts
once; crossover count and traffic share never multiply exposure again.

Left-only scope scales differences in completed left-cohort means by N.
Network scope scales full-cohort total differences divided by matched left
entrants, separately in each seed; implied all-entrant exposure is shown.
This requires a representative movement mix and nonoverlapping systems.
Annual operating cost = N * deltaFuel * fuelPrice
                     + N * deltaFullTripSeconds / 3600 * valueOfTime.
Full trip and total fuel already include detour, queue and restart costs.
Default valuations of $3.50/US gal and $20/vehicle-hour are illustrative,
not current quotes or official guidance. No extra occupancy factor applies.
Crossovers divide the total only for a descriptive per-crossover average.

Annual operations always use the true paired no-closure runs retained by
crashes.js, regardless of replay incident settings or the 1,000x demo.
This does not remove closures by subtraction or rescale demo results.
Censored or unmatched cohorts and zero-left runs block annualization.
Small left samples and excess approximate queue storage produce warnings.
95% Student-t intervals use paired per-seed annual totals, preserving
fuel/time covariance. They exclude input/model/calibration uncertainty.
The exposure sensitivity range is not a statistical confidence interval.

Custom crash valuation is separate and blank by default. It requires
system-wide type rates per million external entrants with matching main
junction/crossover boundaries and exposure. Legacy replay rates are not
calibrated for this boundary and are not silently annualized. Expected
crashes use all entrants, not just lefts. Blank costs remain unknown; only
complete rates produce counts and complete values permit a combined
network scenario. Type alone does not determine severity. Use consistent
dollar years and cost definitions; avoid duplicate delay/fuel valuation.
Construction, land, maintenance, emissions, vehicle wear, induced demand
and unpriced effects are excluded. A single scenario is not statewide data.

Validation: node annual-tests.cjs
Reproduction: node run-annual-study.cjs -> analysis/annual-study.json
The saved study includes 20 paired seeds for shared/yield, pocket/yield
and shared/coordinated-signal scenarios with both red turns enabled.


SOURCED CRASH VALUATION (v1.5)
See crash-cost-methods.html for sources, exact count arrays and mappings.
FHWA-SA-25-021 (October 2025) Table 1 supplies national crash-unit costs
in 2024 USD, classified by maximum K/A/B/C/O severity. Economic cost and
comprehensive cost are alternative totals, not additive. No extra occupant
or vehicle multiplier applies. National values have no Michigan PCI adjustment.
Michigan Traffic Crash Facts 2024 Crash.pdf page 5 supplies all-road severity
counts. Rear-end pools ordinary/left/right rear crashes; sideswipe pools
same/opposite direction. Angle is a broad proxy. Opposing-left is the
head-on-left row. No fixed-object/overturn mix is inferred from single-vehicle
or Other rows. That entire combined fifth group remains unknown.

Severity shares conditional on type are independent of occurrence rates and
type shares. The same statewide severity mixture initially seeds both layouts;
it does not estimate a MUT-specific severity effect. Each layout can be edited
independently. Five percentages must total 100% within 0.0001 percentage point.
A blank entire row is unknown, never zero. Internal source ratios retain full
precision; displayed preset percentages are rounded to six decimals.

Expected cost/layout/type = annual external entrants / 1e6 * type rate *
sum(severity share * crash-unit cost). Difference = Michigan - Standard.
A partial subtotal uses only groups priced in BOTH layouts, without
renormalizing type rates. It is not a bound or a complete safety benefit.
Coverage and excluded expected crashes are displayed. Export retains sources,
unit values, layout-specific profiles, expected severity counts and dollar year.

Replay base-rate mode is an illustrative scenario with unverified boundaries.
It ignores the incident on/off switch and the 1,000x demo multiplier. No
combined total is available for replay-rate mode. Custom rates with asserted
compatibility, complete costs, network scope and matching dollar years can
produce a conditional combined total. An assertion does not repair bad data.
No cost, severity, rate or calibration uncertainty is included in seed intervals.

Validation: node crash-cost-tests.cjs
Reproduction: node run-crash-cost-study.cjs


VERSION 1.6 / INDEPENDENT MODULE 2.0 — 2026-11-03
The original two-layout model is retained. The independent eight-design module now has annual operating costs, optional separate FHWA crash valuation and a full experiment workbench. Open intersection-lab/experiments.html (dist/intersection-lab in the source tree). All 46 model inputs plus 3 valuation inputs have editable fixed values and sweep lists/ranges. Seed/count fields are separate protocol controls.
Exact grids never silently sample. Seeded sampled grids expose their coverage; irrelevant settings and periodic offset aliases are removed. Design settings compete only within matched assumption and valuation cases. Choices are frozen from screening and validated against unchanged baselines with disjoint seeds. Incomplete or storage-flagged cases remain visible. The operating objective excludes crash risk, construction and pedestrians.
The narrower 1,710-setting timing study is preliminary, not a final optimum. Its base-case best hit three searched boundaries, reversed under minor-road-heavy traffic and failed some storage stress cases. Read intersection-lab/research.html before quoting results.
Node: cd dist/intersection-lab; node experiment-tests.cjs; node run-experiment.cjs complete-protocol.json result.json. Protocols and full replication results are exportable from the browser. The full source includes run-mut-sweep.cjs and its preliminary protocol/data under analysis/.
