This project consists of a simulation framework and a collection of simulations written in Scala. Examples include reaction diffusion, fractals, snakes, stocks, dice, fluid flow, and many more.
Download this zip file and unzip it. Then in the bin directory run one of commands indicated below.
Reaction Diffusionbb4-simulator -panel_class com.barrybecker4.simulation.reactiondiffusion.RDSimulator Simulates a interaction between 2 chemicals in a reaction diffusion simulation. The program is based on an applet by Joakim Linde. There are 2 chemicals that react in complex ways as defined by a non-linear differential equation that cannot be solved analytically. The simulation solves it numerically. |
![]() |
Henon Phase Explorerbb4-simulator -panel_class com.barrybecker4.simulation.henonphase.HenonPhaseExplorer The Henon Strange Attractor is defined by the following transformations: |
![]() |
Fractal Explorerbb4-simulator -panel_class com.barrybecker4.simulation.fractalexplorer.FractalExplorer This program allows you to navigate through the most complex object in mathematics, the Mandelbrot set. Drag open a bock to zoom, and click the "go back" button to undo the last zoom. When I created my first implementation of this program in turbo pascal in high school, I can remember waiting for hours for the images to generate (on a 640 by 200 pixel screen). Now its almost instantaneous. |
![]() |
Cave Explorerbb4-simulator -panel_class com.barrybecker4.simulation.cave.CaveExplorer This program allows you generate random caves that might be used in a game or for other purposes. The technique is described in this article. |
![]() |
Conway's Game of Lifebb4-simulator -panel_class com.barrybecker4.simulation.conway.ConwayExplorer This program allows you to simulate Conway's game of life. Color is used to indicate the age of the particles. Several different rule systems are allowed. |
![]() |
Snakebb4-simulator -panel_class com.barrybecker4.simulation.snake.SnakeSimulator Simulate a living snake. The program uses a spring based model to represent the snake. There is a sinusoidal force function applied to each side to simulate muscular contractions. Directional friction is used to make the snake go forward (as happens with a real snake). Snakes have 4 ways of moving: rectilinear progression, horizontal undulatory progression, sindwinding, and concertina progression (rarely used). I only used the most common gait, horizontal undulatory progression, in this demo, but will probably add the others. You can also change the parameters of this gait to get different behaviors. The snake "learns" to move more efficiently by a process of automated optimization. It uses exactly the optimization code I use for improving the performance of the game programs. I now understand really well how a snake moves. Based on work by Gavin Miller in his 1988 SIGGRAPH paper. |
![]() |
Dicebb4-simulator -panel_class com.barrybecker4.simulation.dice.DiceSimulator This simulator evolved out of looking for a good way to explain probability distributions to my son and his clasmates. This simple program illustrates the different sorts of bell-curve (or gaussian) distributions that can arise as you vary the number of dice and the number of sides that they have. |
![]() |
Stock Price Simulationbb4-simulator -panel_class com.barrybecker4.simulation.stock.StockSimulator This simulation was motivated by the following problem. |
![]() |
Stock Trading Simulationbb4-simulator -panel_class com.barrybecker4.simulation.trading.TradingSimulator This work was requested by a friend. The public version of this project has some trivial generation and trading strategies, but there is a private repo that has proprietary strategies. |
![]() |
Habitat Simulationbb4-simulator -panel_class com.barrybecker4.simulation.habitat.HabitatSimulator Create and maintain a set of creatures in a self-sustaining habitat. In the future, I would like to add many more attributes to each creature to make the simulation more realistic. |
![]() |
Verhulst Population Simulationbb4-simulator -panel_class com.barrybecker4.simulation.verhulst.VerhulstSimulator Chaotic behavior can emerge from using a dynamic logistic population growth model like the one researched by Pierr Verhulst. See Rabbits and Coyotes. |
![]() |
Predator Prey Simulationbb4-simulator -panel_class com.barrybecker4.simulation.predprey.PredPreySimulator Simulates foxes (predators) and rabbits (prey) in the wild. Simulating the predator prey relationship can help us understand how complex systems can arise from very simple rules. |
![]() |
Fluid Simulationbb4-simulator -panel_class com.barrybecker4.simulation.fluid.ui.FluidSimulator Deep water simulation based on work by Jos Stam. Use the mouse to stir up the fluid by clicking and dragging. |
![]() |
Liquid Simulationbb4-simulator -panel_class com.barrybecker4.simulation.liquid.LiquidSimulator Particle based fluid simulation based on Nick Fosters SIGGRAPH paper. Numerical instability (due to a bug) causes this simulation to blow up after a relatively short time unfortunately. |
![]() |
2D Deep Water Simulationbb4-simulator -panel_class com.barrybecker4.simulation.water.ui.WaterSimulator Deep water simulation based on work by Kass and Miller. Drag the mouse to interactively change the height of the water or of the ocean floor. |
![]() |
Trebuchetbb4-simulator -panel_class com.barrybecker4.simulation.trebuchet.TrebuchetSimulator Simulate a trebuchet.This program uses a physically based model to represent a trebuchet. When my son and I were watching Lord of the Rings, we noticed that Minas Tirith used trebuchets to defend itself. We built one out of lego, but optimizing lego is tedious, so I made this virtual trebuchet in order to try different designs. The trebuchet can also "learn" to move more efficiently by a process of automated optimization. It uses exactly the optimization code I use for improving the performance of the game programs. This is still a work in progress. I need to use constrained dynamics for the projectile's attachement to the sling (instead of a simple spring based restorative force which leads to instability). When done, I hope to build a trebuchet with my son according to the optimized specifications. |
![]() |
Spirographbb4-spirograph Remember that psychodelic toy from the 70's? Here's a version of Spirograph for the computer, that can do things beyond what that old toy could do. Adapted from work done by David Little. |
![]() |
Sierpinski Trianglebb4-sierpinski This is an example of a self-similar set. \ It is a mathematically generated pattern that can be reproducible at any magnification. \ See Sierpinski Triangle |
![]() |
L-System Treebb4-simulator -panel_class com.barrybecker4.simulation.lsystem.LSystemExplorer Create trees from l-system expressions. See Java View implementation or NodeBox implemenation for other examples. |
![]() |