Deinbac

A simulation framework that currently offers two types of simulation:

Deinbac—an evolutionary simulation

A simulation explaining some principles of evolution.

The idea came from an article in the journal Scientific American. In the 1980s they had a regular feature on little programming exercises, and this program is the implementation and extension of this exercise. At that time, I implemented it on the Atari ST in Pascal, the later porting to Java was fairly easy.

The name is based on a German pun.

Conway's game of life—a cellular automaton
This also came to me via the same series in the journal Scientific American. My first implementation ran on  8-bit Atari computers, but this is not comparable to the possibilities of today's PCs.

How to start the program

  1. You need a Java Runtime Environment on your computer. The easiest way is to get it from www.java.com. There you can also check if you already have it installed.
  2. Download the program Deinbac.
  3. Start it by double-clicking the downloaded file.

A word to the programmers among you

If you want, you can download the source code.

Feel free to use the files in your own projects, as long as you name me and all other contributors to the files you took in use from me.
If you apply changes to my files, please inform me of the result, maybe there are more interested in your improvements.


And here's the manual:

Deinbac

A simulation framework.

Table of Content

Introduction

This program supports several kinds of simulation, as long as they base on discrete time steps. Currently two types of simulation are available.

Deinbac - an evolutionary simulation

It's about the principles of evolution. We have bacterions eating mana. Mana grows at a constant rate. Bacterions are blind, but even though from time to time they find some mana, which gives them energy. A bacterion that has not eaten mana for some time will starve.

Each bacterion has genes which define how fidgety the bacterion moves. A bacterion that grew long enough and has enough energy can split. During that split one gene of the child can change—a mutant.

When two bacterions meet, and both are old enough and have enough energy, then they can have sex. (Our bacterions are hermaphrodite—no male or female, each can mate with each.) The child gets half the genes from each parent.

Through interplay of reproduction, mutation and selection (by starvation) bacterions emerge which fit well to their surrounding.

A word on what you see: Mana is gray. New born, freshly split or mating partners are yellow. All other bacterions are magenta, the darker the less energy they have.

Conway's game of life - a cellular automaton

A cellular automaton following the ruleset defined by John Horton Conway.

The world consists of cells (fields) in a square grid, and cells can be either dead or alive. The state of each cell is defined by simple rules about the previous state of the cell itself and its 8 neighbors. Even in such a simple world some interesting complex phenomena can emerge.

The Menu

Game

Actions dealing with the whole simulation or program.

  New...

Exits the current simulation and starts a new one.

  Languages

Switches the language for the whole program.

  Deutsch (Deutschland)

  English (United States)

  Quit

Quits the program.

Run

  Pause

Pauses the simulation.

  Single step

Performs a single simulation step.

  slow

Sets simulation speed to slow.

  medium

Sets simulation speed to medium.

  fast

Sets simulation speed to fast.

Show world

Toggles the display of the simulated world. On very slow computers, simulation runs faster if display of the world is turned off.

  Magnify

Sets the magnification for the display of the simulated world.

  Zoom level 1 (8x8, detailed)

  Zoom level 2 (4x4, middle)

  Zoom level 3 (2x2, small)

  Zoom level 4 (1x1, tiny)

  Show trend chart

Turns the display of the trend chart window on or off. There you can see the ups and downs of mana in the world (gray), number of bacterions (magenta) and average energy of those bacterions (yellow). (Only available in the Deinbac simulation.)

  Show genealogy

Shows the current genealogy. (Only available in the Deinbac simulation.)

?

Some information about the program.

  Help...

Displays some help about this program.

  About DeinBac...

Displays information about this program.

Start a new simulation

When you start a new simulation, you have several parameters to experiment with.

Simulation type

Which type of simulation you want to start?

Deinbac - an evolutionary simulation

It's about the principles of evolution.

Conway's game of life - a cellular automaton

A cellular automaton following the ruleset defined by John Horton Conway.

Deinbac - an evolutionary simulation

Start parameters for the evolutionary simulation

World

Parameters affecting the world the bacterions live in

World size horizontally

The width of the world.

World size vertically

The height of the world.

World with borders or torus?

  Borders

If the world has borders, bacterions stop at the borders of the world until they turn.

  Torus

In a torus, bacterions exiting left come in right, vice versa, and bacterions exiting above come in below, and vice versa.

Initial mana (ppm)

Value is density in million fields. The value must be in the range from 0.0 to 1000000.0.

Mana to grow each round (ppm)

Value is density in million fields. The value must be in the range from 0.0 to 1000000.0.

Mana to grow each round in cockaigne (ppm)

Cockaigne is a region (1/64 of the world) where mana grows in plenty. This can create two different living environments in the same simulation run.

The value you enter here is additional mana that exclusively grows within the cockaigne. To turn cockaigne off, enter 0.

Value is density in million fields. The value must be in the range from 0.0 to 1000000.0.

Initial number of bacterions

The value must be non-negative.

Bacterions

Parameters affecting the bacterions

Energy per mana

When a bacterion eats 1 mana, it gets energy to survive that many steps. The value must be non-negative.

Maximum energy for bacterion

This is the maximum energy for a bacterion—it will eat more, but this gives no additional energy. The value must be non-negative.

Initial energy

With this level of energy all initial bacterions start. The value must be non-negative.

Minimum energy for split

The value must be non-negative.

Minimum age for split

The value must be non-negative.

Minimum energy for sex

The value must be non-negative.

Minimum age for sex

The value must be non-negative.

Statistics

Parameters affecting the collection of statistics

Trend chart frequency

The trend chart shows mana, bacterions and average energy over time. Here you can define the resolution over time of the trend chart. The value must be non-negative.

Conway's game of life - a cellular automaton

Start parameters for the cellular automaton

World size horizontally

The width of the world.

World size vertically

The height of the world.

World with borders or torus?

  Borders

If the world has borders, the simulation assumes a space of always empty cells around the playfield.

  Torus

In a torus, cells of left and right edge are neighbors, and same for cells of upper and lower edge.

Start pattern

The pattern the world is populated with initially.

Gleiter

A small spaceship moving diagonally with a period of 4.

r-Pentomino

A methuselah - a simple structure staying interesting for a long time, and firing some gliders.

Acorn

A methuselah

b-Heptomino

A methuselah

Loafer

A small spaceship moving vertically.

Copperhead

A small spaceship moving horizontally.

Wing Spaceship

A huge spaceship moving diagonally with a period of 4.

Gosper Glider Gun

A structure firing gliders regularly.

Methuselah 8x32 001

A methuselah

Methuselah 16x16 001

A methuselah

Methuselah zz_Replicator stdin 001

A methuselah

From pattern spec text

Start pattern spec text

'o'=emtpy cell, 'b'=living cell, '$'=line end, '!'=line+pattern end
An (optional) number before a cell character means n times that cell character.

You can find many patterns on https://catagolue.hatsya.com.

During the simulation

You can use the following input methods (besides the menu options) during the simulation.

Mouse

A left mouse click has the following impact:

In Deinbac simulation
Information about the clicked position is given—if Mana is present, and information on any bacterion over this position.
In Life simulation
The cell at this positon toggles between alive and dead.

Genealogy

The genealogy shows all bacterions that ever existed within this simulation run, with all their values and relations. (Only available in the Deinbac simulation.)

ID

The ID of the bacterion. In our world, the younger bacterions have higher IDs.

Position

The position within the world.

Energy

The current energy level of this bacterion. Time brings it down, eating mana brings it up. Zero energy leads to death.

Born

The timestamp when this bacterion was born.

Last event

The timestamp of the last event (either birth, split, sex or death).

Mother

The ID of the mother bacterion, no matter if the mother has split or had sex.

Father

The ID of the father bacterion, if this bacterion was created by sex.

Genes

The genes define how fidgety the bacterion moves. They consist of six digits for the six possible direction changes (sorted clockwise: forward, slightly right, hard right, u-turn, hard left, slightly left). Higher digit values represent a higher probability to move into that direction.

Childs

If this bacterion was able to reproduce by split or sex, lists the IDs of all the direct children.