Code notes
The Mesa simulation is intentionally small enough to read in one sitting.
mesa_model.pydefines the MesaModel, residentAgent, schedule, andDataCollector.generate_mesa_results.pyruns the documented scenarios intomesa-results.json.CityOpportunitySimulator.tsxvisualizes those checked-in Mesa outputs; it does not reimplement the model in TypeScript.capture-actual-app.mjscaptures reproducible screenshots from the real site with Playwright.
Determinism
WorkforceModel creates independent seeded random streams for initialization, awareness, enrollment, completion, and matching. This means a parameter comparison can be reproduced exactly, and a downstream setting cannot perturb an upstream random sequence.
baseline = WorkforceModel(WorkforceConfig(seed=42))
expanded = WorkforceModel(WorkforceConfig(seed=42, training_seats=60))
Only the changed parameter differs between those runs.
Extending the model
Add new resident state to the Resident agent, initialize it in WorkforceModel, then make its effect explicit in one submodel. For example, transportation access could reduce enrollment or job matching without changing awareness.
Keep three rules:
- document every new behavior in the ODD protocol;
- preserve seeded randomness;
- add a metric that makes the behavior observable.