Live: hossbh.github.io/Agent-Based-Modeling-Explorer
Runs in your browser. Nothing to install or download.
Click the picture or the button to open the live Explorer.
An interactive 3-D explorer for agent-based modeling, built for learning and experimenting. Agents follow simple rules, sense their surroundings and react to each other; flocks, segregated towns, epidemics, booms and busts, trails, traffic jams and echo chambers emerge. Pick a model, press play, read every rule, then change one and run your own experiment.
It is the companion to the Cellular Automata Explorer and uses the same layout.
| Model | What it shows |
|---|---|
| Flocking | Boids (Reynolds) in 2-D or 3-D with separation, alignment and cohesion, vision radius and field of view, an optional predator; or the Vicsek model and its order–disorder phase transition. |
| Segregation | Schelling's town: mild preferences for like neighbours add up to strong segregation. Thresholds, a taste for diversity, several groups, three relocation rules. |
| Epidemic (SEIR) | People walk about and infect those nearby. Latent and infectious periods, waning immunity, fatality, vaccination, distancing, self-isolation and long trips, compared with the SEIR differential equations. |
| Predator–prey | Wolves, sheep and regrowing grass with energy budgets: cycles, a phase-plane orbit, and extinction when a feedback is missing. |
| Sugarscape | Epstein and Axtell's agents with different vision and metabolism on a sugar landscape: carrying capacity, selection, wealth inequality (Gini, Lorenz curve), inheritance and a wealth tax. |
| Ant colony | Foraging ants that lay and follow pheromone: stigmergy, trail formation, diffusion and evaporation. |
| Cooperation | The spatial Prisoner's Dilemma (Nowak and May): cooperator clusters, the kaleidoscope, three imitation rules, mutation, well-mixed comparison, synchronous vs. random-order updating. |
| Networks | Voter model, majority rule, bounded confidence and threshold cascades on small-world, random, scale-free and lattice networks, with zealots and hub seeding. |
| Traffic | Nagel–Schreckenberg cars on a ring road: phantom jams, the fundamental diagram, slow-to-start, cruise control and a road-works bottleneck. Earlier ticks stack upward so jams show as backward-leaning stripes. |
| El Farol | Arthur's bar problem: bounded rationality and inductive learning, compared with coin flips. |
- Agents, environment and interaction: state variables, heterogeneity, sensing, direct and indirect (stigmergic) interaction, local vs. well-mixed contact.
- Scheduling: synchronous vs. asynchronous, random vs. fixed order, and models where the choice changes the result.
- Stochasticity: seeded runs, replication, demographic noise and stochastic fade-out.
- Emergence, feedback and tipping points: phase transitions, cascades, oscillations, self-organisation.
- Adaptation, learning and selection: imitation, inductive learning, survival of the fittest without evolution.
- Docking with equation-based models: the SEIR ODE and the replicator equation drawn over the agent results.
- The ODD protocol: a standard Overview, Design concepts and Details description of every model, updated with the current settings.
- Verification, validation, calibration and sensitivity analysis, explained in the Learn section and practised in the lab.
- Case library: 52 ready-made cases across the ten models, each with a short explanation.
- Change the rules: every parameter and rule component is in the setup sheet; settings marked ↻ start a new run, the others act on the running model.
- Read the rules in detail: Fig. 3 lists what each agent does every tick with the current values, the order of events in a tick, a diagram, key derived quantities, every parameter with its default, and the ODD description.
- Inspect an agent: click it in the 3-D view to see its state, what it senses and what it will do next. Boids show their neighbours, people show who infected them, network nodes show their contacts.
- Results: live tiles, time series (with the theory curve where one exists), a distribution or phase-plane panel, and plain-language notes on what the numbers mean.
- Experiments lab: sweep any parameter with several runs per value (common random numbers, mean and ± 1 s.d. band, table), or repeat the current settings with different seeds to see the spread. 18 guided experiments load and run with one click.
- Share and export: Copy link stores the model, settings and seed in the URL; download the time series or lab results as CSV; save the 3-D view as a PNG.
Keyboard: Space play or pause · → one tick · R restart · F fit the view · Esc close the inspector.
The Explorer is a single HTML file with no build step. Download index.html and open it in any modern browser with an internet connection (three.js and the fonts load from CDNs).
- Every model is a small module with its parameters, an
initand astepthat touch only their own world, anobservethat returns the measures, and functions that describe its rules, ODD and diagram. The same code runs in the 3-D view and, off-screen, in the lab. - Random numbers come from a seeded generator, so the same seed and settings always give the same run.
- Agents are drawn as instances of a few meshes (three.js
InstancedMesh); fields such as pheromone are a height surface; networks and trails are line segments. - Neighbour searches use spatial hashing (boids, epidemic) or precomputed neighbour tables (lattices), so a tick takes a few milliseconds.
- The lab runs in short slices between frames, so the page stays responsive during a sweep.
- Light and dark themes follow the system setting or the toggle in the top bar.
- T. C. Schelling, “Dynamic models of segregation”, Journal of Mathematical Sociology 1(2), 143–186, 1971.
- C. W. Reynolds, “Flocks, herds and schools: a distributed behavioral model”, Computer Graphics 21(4), 25–34, 1987.
- T. Vicsek et al., “Novel type of phase transition in a system of self-driven particles”, Physical Review Letters 75, 1226–1229, 1995.
- W. O. Kermack and A. G. McKendrick, “A contribution to the mathematical theory of epidemics”, Proceedings of the Royal Society A 115, 700–721, 1927.
- J. M. Epstein and R. Axtell, Growing Artificial Societies: Social Science from the Bottom Up. Brookings / MIT Press, 1996.
- M. Resnick, Turtles, Termites, and Traffic Jams. MIT Press, 1994.
- M. A. Nowak and R. M. May, “Evolutionary games and spatial chaos”, Nature 359, 826–829, 1992.
- B. A. Huberman and N. S. Glance, “Evolutionary games and computer simulations”, PNAS 90, 7716–7718, 1993.
- G. Deffuant et al., “Mixing beliefs among interacting agents”, Advances in Complex Systems 3, 87–98, 2000.
- M. Granovetter, “Threshold models of collective behavior”, American Journal of Sociology 83(6), 1420–1443, 1978.
- D. J. Watts, “A simple model of global cascades on random networks”, PNAS 99(9), 5766–5771, 2002.
- D. J. Watts and S. H. Strogatz, “Collective dynamics of ‘small-world’ networks”, Nature 393, 440–442, 1998.
- A.-L. Barabási and R. Albert, “Emergence of scaling in random networks”, Science 286, 509–512, 1999.
- K. Nagel and M. Schreckenberg, “A cellular automaton model for freeway traffic”, Journal de Physique I 2(12), 2221–2229, 1992.
- W. B. Arthur, “Inductive reasoning and bounded rationality”, American Economic Review 84(2), 406–411, 1994.
- V. Grimm et al., “The ODD protocol for describing agent-based and other simulation models: a second update”, JASSS 23(2), 7, 2020.
- S. F. Railsback and V. Grimm, Agent-Based and Individual-Based Modeling: A Practical Introduction, 2nd ed. Princeton University Press, 2019.
- U. Wilensky and W. Rand, An Introduction to Agent-Based Modeling. MIT Press, 2015.
The full list of 27 references is in the Learn section of the Explorer.
3-D rendering by three.js (MIT licence). Fonts: Archivo and STIX Two Text from Google Fonts. The models are independent implementations of the published models cited above.
© 2026 Hossein Basereh. All rights reserved.