Model Library
Runnable MathPets models
Browse the examples that are currently backed by real MathPets source. Search by name or topic, or filter by category.
Showing all 34 runnable simulations
Cellular automataFire
Patch-driven spread on a bounded world. Left-edge trees ignite on setup and the fire advances one tick at a time.Validate patch neighborhoods, synchronous spread, and simple editable parameters.
Cellular automataLife
Patch-only cellular automaton that pressures synchronous update semantics.Validate deterministic, synchronous cellular updates over a patch grid.
Biology & ecologyAnts
A direct port of the classic foraging model with nest scent, chemical trails, and three food piles.Validate patch fields, sensing, motion, and layered visualization pressure.
Cellular automataHierarchical Cellular Automaton
A two-level cellular automaton where clusters and districts change the local birth and survival rules.Validate multi-scale patch aggregation, regional rule switching, and hierarchical color mapping.
Biology & ecologyFlocking
Local pet interactions with heading and neighborhood queries.Validate local pet queries, heading math, and wraparound movement.
NetworksNetwork Example
A small random network that proves links are first-class agents.Validate link creation, link querying, link updates, and board rendering.
NetworksVirus on a Network
Contagion over a contact network with first-class link agents.Validate links as a real ABM primitive under stochastic network dynamics.
NetworksDiffusion on a Directed Network
Value flows through asymmetric links, collecting in sinks and amplifying hubs.Validate directed link creation, outgoing-neighbor diffusion, and link-state visualisation.
NetworksTeam Assembly
Short-lived teams grow a collaboration network from newcomers, incumbents, and repeat partnerships.Validate team-sized cohorts, collaboration memory, link ageing, and agent retirement.
Social dynamicsEthnocentrism · Alternative Visualisation
Cooperation traits evolve under same-group and different-group Prisoner's Dilemma interactions.Validate inherited traits, local social payoffs, mutation, reproduction, and an alternate shape-plus-colour visualisation.
Social dynamicsYour X Posting Rhythm
A 24-hour activity portrait tuned from aggregate timing and post-type statistics.Explore how a personal activity rhythm changes when timing and conversational habits are represented as a small generative model.
NetworksYour X Audience Cascade
A synthetic diffusion network tuned from aggregate audience and engagement statistics.Explore how audience scale, connectivity, and engagement probability interact to grow or extinguish a cascade.
Social dynamicsSugarscape
Agents harvest a renewable sugar landscape, spend energy to live, and die when their budget runs out.Validate spawn blocks, ranked patch selection, resource regrowth, energy budgets, and death.
Social dynamicsSchelling Segregation
Households relocate when too few nearby neighbors match them, producing large-scale sorting from local preferences.Validate patch-local social rules, boolean satisfaction fields, and random relocation into empty patches.
Cellular automataLife Pet-Based
The same Life rules under a pet representation rather than pure patches.Validate the same system rules under a pet-centric representation.
Biology & ecologyTermites
Wood chips live on patches, termites carry one chip at a time, and piles emerge from repeated local behavior.Validate patch-as-data, carrying state, and long-form pet behavior cycles.
Biology & ecologyWolf Sheep Predation
Predator-prey dynamics with wolves and sheep, optionally with regrowing grass.Validate multiple breeds, birth and death, energy budgets, and renewable patch resources.
Physics & patternsTuring Diffusion
A patch-only reaction-diffusion system where pattern emerges from coupled U/V fields and board color follows field values.Validate continuous patch fields, coupled diffusion, and color-mapped field rendering.
Cellular automataWolfram Automaton
An elementary cellular automaton that writes each new generation onto the next board row using a selectable rule, optional flip errors, and dependency coloring.Validate one-dimensional cellular rules, history-as-board rendering, user-selectable Wolfram rule numbers, and causal error propagation.
Physics & patternsWaves
A patch-only vibrating membrane where a central oscillator sends circular ripples that reflect and interfere at the walls.Validate coupled continuous patch fields, staged neighbor sampling, and tick-driven forcing with diverging color scales.
Biology & ecologySlime
Physarum-style mold cells deposit a diffusing, evaporating chemical and climb its gradient, condensing random walks into trail networks.Validate gradient sensing, patch deposition, and the diffuse/evaporate feedback loop behind emergent trail networks.
Social dynamicsTraffic
Nagel-Schreckenberg cars on a ring road accelerate, brake for the car ahead, and randomly hesitate until phantom jams appear.Validate coordinate pet lookup, defs over agent occupancy, and stochastic per-agent dynamics on a wrapped axis.
Social dynamicsTraffic Grid
Cars cross a downtown grid of one-way streets where synchronized lights meter every intersection — until queues spill back and gridlock.Validate two-direction occupancy checks, patch-at light lookups, and intersection state driven by the global tick on a torus grid.
Social dynamicsCouriers
A delivery fleet works a city from a central depot: orders pop up at houses, couriers race to the nearest one, and waiting times reveal queueing theory's cliff edge.Validate ranked nearest-patch choice, claim handoff through patch fields, match-driven courier state machines, and fleet monitors over pet aggregates.
Physics & patternsLattice Gas
An HPP lattice gas where four boolean channels per patch collide and stream, sending density waves out of a central blob.Validate multi-phase staged patch updates and directed neighbor streaming with exact particle conservation.
Cellular automataMaze
Runners solve preset-stamped labyrinths by following a scent that diffuses from the exit — walls block both.Validate wall semantics: movement blocking, wall-aware fields, preset wall layouts, and the wall brush.
Chaos & fractalsLogistic Map
Two logistic-map trajectories that start a hair apart march across the board one column per tick, making chaotic sensitive dependence visible as the traces split.Validate model memory as iterated dynamical state, tick-driven column painting, monitors over memory values, and a board-filling stop condition.
Chaos & fractalsFractal Tree
A single walker climbs from the bottom of the board painting a trunk, then recursively splits into angled children that draw a self-similar tree colored by depth.Validate recursive pet spawning via hatch with field hand-off, depth-indexed patch painting, and runs that end by population extinction.
Physics & patternsPercolation
Water seeps from the top of a random porous medium, soaking any open pore that touches a wet neighbor — and whether it ever reaches the bottom depends sharply on porosity.Validate staged neighbor spread, enum patch states, memory-based stall detection, and a parameter that crosses a phase transition.
Physics & patternsSandpile
The Bak-Tang-Wiesenfeld sandpile: drop one grain at a time and watch overloaded patches topple onto their neighbors, triggering avalanches of every size.Validate multi-phase step sequencing, synchronous neighbor-driven toppling, guarded patch-at lookups in defs, and memory-driven random drop sites.
Biology & ecologyFireflies
Wandering fireflies carry phase clocks and nudge them forward whenever a neighbor flashes, until the whole field blinks in unison.Validate per-pet clocks, staged perception of a visible state, and radius-query coupling between moving pets.
Social dynamicsPrisoner's Dilemma
Every patch plays cooperate or defect against its eight neighbors, then copies its highest-scoring neighbor — kaleidoscopes of cooperation and defection unfold.Validate staged two-phase patch dynamics, neighborhood payoff aggregation, and strategy imitation with display states.
NetworksSmall World
A Watts-Strogatz ring lattice where a few rewired shortcuts collapse how long a message takes to reach everyone.Show the small-world effect: a few random shortcuts through a clustered ring dramatically shorten spreading time.
NetworksPreferential Attachment
Barabasi-Albert network growth: newcomers attach to well-connected nodes, and a few hubs end up owning the graph.Grow a scale-free network and watch hubs emerge from degree-proportional attachment.
