Skip to content

Repository files navigation

bb4-simulations

CI

Interactive Scala/Swing simulations of physical, mathematical, and procedural systems — reaction–diffusion chemistry, Mandelbrot navigation, fluid flow, Conway’s Game of Life, spring-based snakes, stock trading strategies, wave-function collapse, and more. Each app shares a common simulator framework so you can tweak parameters and watch the system evolve in real time.

Screenshots

Reaction Diffusion
Reaction Diffusion
Henon Phase Explorer
Henon Phase
Fractal Explorer
Fractal Explorer
Cave Explorer
Cave Explorer
Dungeon Generator
Dungeon Generator
Conway's Game of Life
Conway's Life
Snake
Snake
Dice
Dice
Stock Price
Stock Price
Stock Trading
Stock Trading
Habitat
Habitat
Verhulst Population
Verhulst
Voronoi Explorer
Voronoi Explorer
Predator Prey
Predator Prey
Fluid
Fluid
Liquid
Liquid
Water
Water
Trebuchet
Trebuchet
Spirograph
Spirograph
Sierpinski Triangle
Sierpinski
L-System Tree
L-System Tree
Wave Function Collapse
Wave Function Collapse

Click a thumbnail to open the full-size image.

Simulations

Simulation Gradle task Description
Reaction Diffusion runReactiondiffusion Two-chemical reaction–diffusion patterns (Gray–Scott style).
Henon Phase Explorer runHenonexplorer Explore parameters of the Hénon strange attractor.
Fractal Explorer runFractalexplorer Zoom the Mandelbrot set; drag to zoom, undo with go-back.
Cave Explorer runCave Generate cave maps with cellular automata.
Dungeon Generator runDungeon Procedurally generate dungeon levels.
Conway’s Game of Life runConway Cellular automaton with alternate rule sets; color shows age.
Snake runSnake Spring-based snake locomotion (Gavin Miller, SIGGRAPH 1988).
Dice runDice Histogram of rolling N dice with M sides.
Stock Price runStock Expected outcomes for volatile stocks over many periods.
Stock Trading runTrading Compare trading strategies on simulated price paths.
Habitat runHabitat Multi-creature habitat with predator/prey dynamics.
Verhulst Population runVerhulst Discrete logistic (Verhulst) population growth / chaos.
Voronoi Explorer runVoronoi Poisson-disc sampling and Voronoi diagrams.
Predator Prey runPredprey Fox and rabbit population curves over time.
Fluid runFluid Deep-water fluid dynamics (Jos Stam); drag to stir.
Liquid runLiquid Particle-based liquid simulation (Foster et al.).
Water runWater 2D deep-water waves (Kass & Miller); drag to reshape.
Trebuchet runTrebuchet Physically based trebuchet with tunable parameters.
Spirograph runSpirograph Parametric spirograph curves.
Sierpinski Triangle runSierpinski Classic self-similar triangular fractal.
L-System Tree runLsystem Fractal trees from L-system expressions.
Wave Function Collapse runWaveFunctionCollapse Procedural scenes from seed images or tile sets.

Developer / demo apps (not packaged as installers): runGraphing, runFuncinverse, runParameter, runComplexmapping.

Running it

Option 1 — installer (recommended): download the installer for your OS from the latest release (macOS .dmg, Windows .msi, Linux .deb — one installer per simulation).

Option 2 — from source:

git clone https://github.com/bb4/bb4-simulations.git
cd bb4-simulations
./gradlew runReactiondiffusion   # or runSnake, runFractalexplorer, runFluid, …
./gradlew tasks --group application   # list all runnable simulations

The default ./gradlew run launches the Dice simulator. Most apps share the SimulatorApp entry point with a -panel_class argument; Gradle creates a run<App> task for each entry in appMap.

Using it as a library

Published artifact (latest release 2.1):

implementation 'com.barrybecker4:bb4-simulation:2.1'

See the releases page if you need a different version.

What's inside

  • com.barrybecker4.simulation.common — shared Swing simulator framework (Simulator, SimulatorApp, options dialogs, animation hooks)
  • Per-simulation packages under com.barrybecker4.simulation.* — model and UI for each app in the table above (e.g. reactiondiffusion, fractalexplorer, snake, fluid, waveFunctionCollapse)
  • Standalone launchersSpirograph and SierpinskiApplet also ship as their own start scripts (bb4-spirograph, bb4-sierpinski)

Building from source

See the Building bb4 Projects wiki.

License

MIT — see LICENSE.

About

A collection of java simulations. Examples include reaction diffusion, fractals, henon phase exploration, snakes, dice, and fluid flow.

Topics

Resources

Stars

3 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages