Skip to main content

Module simulation

Module simulation 

Source
Expand description

Simulation systems: cellular automata, N-body physics, reaction-diffusion, epidemiological models, and traffic simulation.

Structs§

BelousovZhabotinsky
Simplified 3-variable BZ reaction model on a 2D grid.
Body
A gravitational body.
BriansBrain
BzParams
Parameters for the Belousov-Zhabotinsky oscillator.
CellularAutomaton
Generic 2D cellular automaton grid.
FitzHughNagumo
FitzHugh-Nagumo excitable medium — models action potentials and spiral waves.
ForestFire
Probabilistic forest fire cellular automaton.
GameOfLife
Conway’s Game of Life.
GrayScott
Gray-Scott reaction-diffusion system. Models Turing pattern formation.
GrayScottPreset
Preset parameters for Gray-Scott system.
IntelligentDriverModel
Intelligent Driver Model (IDM) parameters.
LangtonsAnt
Langton’s Ant — universal Turing machine on a 2D grid.
NBodySimulation
N-body simulation state.
NagelSchreckenberg
Nagel-Schreckenberg cellular automaton traffic model.
OrbitalElements
Classical orbital elements.
SeirdModel
SEIRD model with Exposed and Deceased compartments.
SirCell
Per-cell state for spatial SIR model.
SirGrid
Spatial SIR model on a 2D grid.
SirModel
Susceptible-Infected-Recovered (SIR) model.
Totalistic1D
Wolfram elementary 1D cellular automaton (256 rules).
Vec3
Vehicle
Vehicle in the IDM model.
WireWorld
WireWorld cellular automaton — simulates digital electronic circuits.

Enums§

AntDir
BrianCell
Brian’s Brain 3-state automaton.
ForestCell
Cell states for forest fire model.
OctreeNode
Node in the Barnes-Hut octree.
WireWorldCell
WireWorld cell states.

Functions§

barnes_hut_step
Barnes-Hut O(n log n) gravity step.
direct_gravity_step
Direct O(n²) gravity calculation and Euler step.
from_state_vectors
Compute orbital elements from state vectors.
leapfrog_step
Leapfrog (Störmer-Verlet) symplectic N-body step.
solve_kepler_equation
Solve Kepler’s equation M = E - e*sin(E) for eccentric anomaly E.
to_state_vectors
Convert orbital elements to state vectors.