Tutorials

AI-generated illustration of four compact wheeled robots on a dark synthetic bay, with gold zone rectangles, teal charging pads, and faint crossing travel traces. Simulation only.
Tutorial

How I built a simulation-only fleet lab that compares greedy, Hungarian, and auction allocators

A portfolio walkthrough of multi-robot-task-allocation: a simulation-only lab that assigns eight coverage zones to four robots on a synthetic bay, compares greedy, exact-enumeration Hungarian, and auction allocators, and records a 55-row CI report. How to run it, what the numbers are, and the honest limits, including a myopic charge wrapper and Playwright installed without OS apt deps. Simulation only. The dashboard is recorded CI output and does not run the simulator.

Arpan Bom9 min read
ShareXLinkedIn

This is a simulation only

This is a portfolio demo. It is not a real robot fleet, not a warehouse manager, not multi-agent path finding, and not a production scheduler. A small Python lab assigns eight coverage zones to four robots on a synthetic 20 m by 16 m bay, then inserts capacity-limited docking and charging as service chains. Travel is independent Dijkstra on a static graph: robots may occupy the same edge. A zone counts as covered when a robot finishes work at the zone centroid; that is not a swept footprint of the rectangle. The GitHub Pages dashboard shows recorded CI output only. It does not run the allocator or the simulator in the browser. I did not invent assignment, auction, or shortest-path methods.

Try the live demo

The fastest way to see the recorded result is the static dashboard on GitHub Pages: https://applycoding.github.io/multi-robot-task-allocation/

The page title is "multi-robot-task-allocation simulation only." The header repeats "Simulation only", "Synthetic fleet scenarios; not a live allocator", "Recorded CI output; this page does not run the simulator", and "Independent travel is not multi-agent path finding; robots may occupy the same edge." The dashboard loads report.json from the same origin, draws a bar chart of recorded makespans, and lists the 55 evaluation rows. It does not fall back to the committed sample report when sample is false, and it does not open a network connection to a simulator.

The live GitHub Pages dashboard of multi-robot-task-allocation, with the simulation-only title, a commit SHA, a makespan chart, and evaluation rows. Simulation only. Recorded CI output; this page does not run the simulator.

Image: Playwright capture web/artifacts/demo.png from GitHub Actions run 43050022381 on commit ea1c14d. Simulation only. applycoding.com.

What the project is

multi-robot-task-allocation (repo: applycoding/multi-robot-task-allocation, commit ea1c14d) is an original teaching implementation of a simulation-only fleet lab, inspired by the idea-only references in REFERENCES.md and NOTICE: assignment and routing ideas from google/or-tools, linear sum assignment ideas from SciPy, shortest-path ideas from NetworkX, the Bertsekas auction algorithm, the Kuhn and Munkres assignment papers, and the Gerkey and Mataric multi-robot task-allocation taxonomy (DOI 10.1177/0278364904045564). Those are references. I did not copy their sources, and I did not invent those methods.

The stack at this commit is:

Layer Role
world and eval.generate Frozen synthetic bay, 8 zones, 4 robots, 2 capacity-1 chargers, hashed fixtures
alloc.greedy, alloc.hungarian, alloc.auction Three epoch allocators, plus random and never_charge mutants
alloc.wrapper Myopic residual check and charge or dock insertion against a committed slot calendar
sim Discrete-event simulator with linear battery drain and next_fit slots
eval.gates and eval.report Schema version 1 report with a 55-row manifest
web/ Vite dashboard that renders that recorded report

The allocator labelled Hungarian is exact enumeration of legal assignments for this 4-robot fleet. It is not a shipped Kuhn-Munkres implementation. Tests compare its cardinality and finite cost-sum against a test-only Kuhn-Munkres oracle. Hungarian optimality applies only to one frozen epoch cost matrix, not to the closed-loop schedule. After Hungarian or auction produce a candidate matching, the wrapper re-validates each pair in a locked order against the updated calendar. A pair that was feasible when the matrix was built can be dropped. Leftover robots then go through a greedy pass.

Auction is a Bertsekas-style forward auction on benefit minus price, with epsilon 0.5 seconds and four dummy idle objects. The honesty bound used in tests is that the sum of real-real finite assignment costs is at most OPT + 2.0 seconds, where OPT is the Hungarian unperturbed finite cost sum at the same cardinality.

Build and run locally

CI uses Python 3.12 on ubuntu-24.04 with hashed wheels from requirements.lock, thread limits OMP_NUM_THREADS=1, OPENBLAS_NUM_THREADS=1, MKL_NUM_THREADS=1, NUMEXPR_NUM_THREADS=1, and PYTHONHASHSEED=0. A local session looks like this:

python3.12 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
pip install --require-hashes -r requirements.lock
pip install . --no-deps
export OMP_NUM_THREADS=1 OPENBLAS_NUM_THREADS=1 MKL_NUM_THREADS=1 NUMEXPR_NUM_THREADS=1 PYTHONHASHSEED=0
ruff check src tests
mypy src/multi_robot_task_allocation
pytest --cov=multi_robot_task_allocation --cov-fail-under=80
mkdir -p /tmp/mrta-runs
scripts/ci-run-report.sh /tmp/mrta-runs "$(git rev-parse HEAD)"

The dashboard preview is separate: cd web && npm ci && npm run dev loads sample_report.json only if you have not copied a real report.json into web/public/. The deployed Pages report must have sample: false. The app does not fall back to the sample on a missing production report; it shows an error state instead.

CI installs Playwright Chromium with npx playwright install chromium and omits --with-deps. Installing OS packages through apt failed on ubuntu-24.04 with temporary DNS errors resolving azure.archive.ubuntu.com. Tests still run on the libraries already present in the runner image. That deviation is disclosed in the README and in PLAN Decision K.

Results from the tests

On commit ea1c14d, GitHub Actions run 43050022381 completed every job in ci.yml (core, web, and pages). The actor and triggering_actor were applycoding.

  • The core job reported 68 passed in 2.76s for the pytest suite, including the injected death-in-slot unit and simulator tests. Aggregate coverage was 81.34% (1567 statements, 235 missed) with --cov-fail-under=80. That figure omits cli.py, as declared in pyproject.toml.
  • The report generator wrote 55 logs, one per manifest row: 39 non-mutant rows (greedy, Hungarian, and auction on 13 eval seeds), 13 random rows, and 3 never-charge rows on S2 only. Every row has pass: true, which for a mutant means the expected failure was observed.
  • The web job reported Vitest 1 passed (it imports the real HONESTY constants from main.ts) and Playwright 4 passed (4.1s), and it uploaded a 1280 by 720 screenshot.
  • The report at this SHA has git_sha ea1c14de10d9ba06168c512bbf9b54e130583707, schema_version 1, gate_version mrta-gates-v1, run_id ci, and sample false.

The same 55-row report, including makespan_s, deaths, world_sha, and log_sha, was reproduced locally from this SHA. The live Pages report.json matches that file.

Measured values from that report (not merely the pass bounds):

Family Allocator Makespans (s) at the eval seeds Notes
S1 greedy, Hungarian, and auction (tied) 60.90, 60.90, 60.94 Travel also tied: 52.39 m, 51.52 m, 73.41 m. Deaths 0, coverage complete. Horizon 150 s.
S2 greedy, Hungarian, and auction (tied) 133.86, 167.48, 139.99 Charge wait 96.62 s, 92.43 s, 87.86 s. Deaths 0. Horizon 200 s, start SOC 0.35.
S3 greedy, Hungarian, and auction (tied) 269.54, 267.71, 250.39 One dock. Dock wait is strictly positive on all nine non-mutant rows (minimum 1.84 s, 7.90 s on six of the nine). Horizon 300 s.
S4 greedy 80.37, 85.47, 103.59, 113.57 Horizon 200 s.
S4 Hungarian and auction (tied with each other) 80.37, 85.47, 92.00, 113.57 Hungarian is at most greedy on all four seeds. The only strict gap is seed 20261143.

Non-mutant rows finish with zero deaths on every eval seed. The random mutant fails all 13 eval seeds (coverage incomplete; S2 also records 4 deaths per seed). The never-charge mutant fails all three S2 seeds with 4 deaths each. Across those six failing S2 runs there are 24 recorded deaths, and none of them occur inside a charging or docking slot.

License and references

Apache-2.0. Copyright 2026 Arpan Bom. See LICENSE and NOTICE.

NOTICE lists the pinned Python and Node dependencies with licenses, including numpy 2.5.4, pytest 9.2.0, pytest-cov 7.1.0, coverage 7.17.2, ruff 0.17.4, mypy 2.4.1, hatchling 1.33.0, pip-tools 7.6.2, Vite 8.3.8, TypeScript 7.0.2, Vitest 5.1.0, @playwright/test 1.65.0, and @types/node 26.6.6. It lists the GitHub Actions SHA pins used by ci.yml, and the CI browser downloads used by Playwright 1.65.0: Chrome for Testing 158.0.8127.18 and Playwright ffmpeg v1013. It points at REFERENCES.md for idea-only references.

How this was verified

I ran the standard portfolio-tutorial checks against commit ea1c14de10d9ba06168c512bbf9b54e130583707 on main.

  • The GitHub repo is not a fork. gh api repos/applycoding/multi-robot-task-allocation reports "fork": false.
  • main has six commits, all with author and committer Arpan Bom (applycoding@gmail.com): the planning commit 1d447b5, the squash 6dba797, then 3121e31, a73b754, 0ba4805, and ea1c14d. git log --format=%B main has no Co-authored-by trailers. The only remote branch at this SHA is main.
  • A search of the tree found no third_party, vendor, or external directories, and no "ported from", "adapted from", or "copied from" markers in the authored source. There are no U+2014, U+2013, or U+2212 characters in project-authored files, commit messages, or the live dashboard page and its JavaScript.
  • This is an original implementation of a simulation-only fleet lab, inspired by the projects and papers credited above. I did not invent those methods, and I did not copy those sources. The allocator labelled Hungarian is exact enumeration for this 4-robot fleet, checked against a test-only Kuhn-Munkres cost-sum oracle, not a shipped Kuhn-Munkres implementation.
  • At ea1c14d, NOTICE names the direct Python, Node, Actions, and Playwright browser pins, and it points at REFERENCES.md. The repo license is Apache-2.0. The LICENSE file is byte-identical to the official Apache-2.0 text from apache.org (sha256 cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30).
  • Commands, paths, APIs, and the numbers in this tutorial were checked against the repo at ea1c14d and against the live demo. The 68 pytest passes, 81.34% aggregate coverage, Vitest 1 passed, and Playwright 4 passed (4.1s) are from GitHub Actions run 43050022381 on that commit. That run also deployed Pages and uploaded the dashboard screenshot. The live report.json has git_sha ea1c14de10d9ba06168c512bbf9b54e130583707 and sample false, and a local regeneration of the 55-row report at this SHA was identical, including log_sha. The live document title includes "simulation only." Both the actor and the triggering actor of the run are applycoding.
  • Independent checks at this SHA: PLAN Decision I ship numbers match the report; the Vitest case imports HONESTY from main.ts; the screenshot upload path web/artifacts/demo.png existed in this CI run; tests/test_slots.py covers an injected death inside a charging slot; none of the 24 recorded eval deaths are inside a slot; --with-deps is omitted and disclosed in the README and in PLAN Decision K.
  • This project is a simulation-only portfolio demo. The dashboard is recorded CI output and does not run the allocator or the simulator.

Limits

This is a portfolio demo. It is simulation only, on synthetic scenarios, and not a warehouse management system or a certified multi-robot coordinator. The Pages dashboard does not run the allocator or the simulator. Travel is independent and is not multi-agent path finding; robots may occupy the same edge. Centroid coverage is not a swept zone. Hungarian optimality is per frozen epoch matrix only, and the shipped allocator is exact enumeration, not Kuhn-Munkres. The charge wrapper is myopic, and sequential slot revalidation can drop a pair that was feasible when the epoch matrix was built. Auction is epsilon-optimal within OPT + 2.0 seconds on the epoch's real-real finite cost sum. CI installs Playwright Chromium without --with-deps because apt DNS to azure.archive.ubuntu.com failed on ubuntu-24.04. Coverage of 81.34% is the aggregate package figure and omits cli.py.