Garbage Collection Lifecycle

js

1. Terrain source

—

2. Parameters

Click Run simulation to start.

3. Day playback

Day 1 · Month 1 · Week 1

4. Layers

0 — —
cmocean.phase (cyclic). Cycles once across the elevation range.
0° — —
White → black, multiplied over elevation. Steep cells darken the layer below. Ticks are slope angles (degrees).
Cyan polyline depot → stops → landfill, routed through a least-energy field on the elevation grid (nearest-neighbour on cost-distance, not Euclidean).
Orange circles, area ∝ mass collected at the stop.
Filled contours over cost-distance from the landfill — 6 bands, innermost = densest. Pools in valleys, blocked by ridges. Dashed circle = isotropic-equivalent r_iso for reference.

5. Result

—

Weekly mass disposed

Hover bar = week N, current = orange.
Self-describing input + configuration + output metrics. application/ld+json.
based on simulation.py · Spec.md
Mass: — kg
Distance: — u
Pickups: —
Toxic r: —

Pick FABDEM extent on map

Pan and zoom to frame your area of interest. The visible bounds become the FABDEM extent. Stay under 50 MB (cell count × 4 bytes) — the button below disables itself when you exceed it.

Bounds: — Size: —

Advanced parameters

Tweak the visualization stretch and the energy-field physics that drive the toxic cloud and the collection routes. Visualization changes take effect immediately; physics changes apply on the next Run.

Visualization

Stretch the cmocean.phase palette to the central pmax−pmin% of cells; outliers saturate at the ends. Slope strength is the maximum darkening factor of the multiply blend at the steepest slope.

Toxic cloud physics — gas dispersal

Step cost: α·dist + β·max(0,Δh) uphill, max(0, α·dist − η·β·|Δh|) downhill (clamped at zero). Higher β → ridges block more dramatically. Higher η → cloud pools deeper in valleys and runs farther downslope.

Routing physics — truck energy

Same cost shape as the cloud, but with truck physics: cheap flat cost, modest uphill penalty, slight recovery downhill. Mirrors the sampasimu energy model defaults.

Garbage Collection Lifecycle — Simulator

Annual simulation of three actors from Spec.md: a Garbage Collector, a Landfill Operator, and a Waste Regulator. The simulation runs entirely in the browser — no server, no Python.

Cadence

Monthly: Regulator issues fresh pickup locations (default 10 / month) and the Collector plans the route through the elevation grid. Daily: Collector follows the planned route, picks up at every location, then delivers to the landfill. Weekly: Landfill disposes the accumulated payload, emits a toxic cloud, and reports KPIs to the Regulator.

Route planning — least-energy paths

Each segment of the daily route (depot → stop1, stop1 → stop2, …, stopN → landfill) is a Dijkstra-shortest path on the elevation grid under truck physics: α=0.008 per metre flat, β=1.0 per metre uphill, η=0.1 downhill recovery — same asymmetric energy model as the sister sampasimu app. The visit ORDER is itself nearest-neighbour on cost-distance (not Euclidean), so a stop on the wrong side of a ridge gets visited later in favour of a flatter "farther" one. Routing runs on a downsampled (~250-cell) version of the DEM to keep the per-month plan under ~150 ms.

Toxic cloud — terrain-aware

Each weekly disposal seeds a plume of nominal radius r₀ = 5·(mass/1000). Per-day area decay is r(t) = r₀·(½)^(t/2); multiple events superpose by area to give the day's budget, r_iso (the dashed circle on the map).

The plume itself is a cost-distance flood from the landfill on the elevation grid, with an asymmetric step cost: α·dist + β·Δh uphill, max(0, α·dist − η·β·|Δh|) downhill (clamped at zero so Dijkstra stays well-defined). Defaults: α=1, β=8 (steep uphill cost — ridges substantially block the spread), η=0.4 (downhill recovery — heavy gas pools in valleys and runs farther downslope). The cloud is rendered as filled contours at six iso-cost bands plus thin contour lines at every band boundary. On flat terrain the plume collapses back to a circle of radius r_iso.

Visual layers

Elevation uses cmocean.phase — a cyclic palette better at separating subtle terrain bands than a sequential ramp. Slope shading sits on top with multiply blend mode: flat areas pass white through (no change), steep areas darken whatever is underneath, giving a shaded-relief look. Each layer has independent visibility + opacity. The day slider scrubs through the year; autoplay loops at ~6 fps.

Determinism

The same seed gives the same hill arrangement, the same monthly location sets, and the same per-day payload masses. The numerics use a Mulberry32 PRNG — not bit-identical to Python's random, but seeded the same way for reproducibility within the JS port.