Workbench Simulator

Welcome to the genetic algorithm lab!

There are 4 main panels in this app, you are currently in the 'Workbench Simulator' panel.
Each panel has a 'Guide' sub-panel like this one that should help you with their usage.
Your progress on the page is maintained (locally) across page reloads.

In this panel you can play with the parameters of the GA and world design, visualize the simulation and live preview the perfomance of the current generation in the 'Current simulation info' sub-panel below.

When the simulation is running you can't modify the parameters, so you'll have to pause the game to do so.

Once a parameter value is changed its selector will light up in orange. That means you have to press 'apply' to make the simulator reflect the change.

Some parameters need the world to restart in order for their effect to be visible.

If you changed one of these parameter the 'Start from scratch' button will light up in yellow to encourage a full restart. Another option is hitting 'Run to start of year' which will terminate the current year with the old parameters and enforce the changes at the end.

You can save the current settings as a preset by hitting 'save' (make sure to apply first, i.e. have no orange selectors).

Saved settings can be viewed and managed in the 'Saved settings' panel below.
Once you saved some interesting preset you can systematically compare them with the 'Experiment panel' below.

Original applet info
Credits for the original applet David Eck

Stats for year 45.  High Score: 31, Average Score: 13.2




Genetic alg. parameters



World Design



						
					    
Trace plot

The first graph will show average score, high score and 'hya' (hundred years average) every 10 years.

You can click on the legend elements above the plot to hide/show a particular trace.
You may want to hide the 'highscore' to see more clearly the averages


Genome plot

The second graph shows the genome of the currently best individual. the genome is a collection of 64 quadruples \(state, perc, whatToDo, newState\).

The eaters have 16 internal states (enumerated from 0 to 15 in the graph). The number of each internal state has no absolute meaning, the eater simply has 16 internal states it can be in, regardless of where it is.

The role of these states is to allow the eater to have a behavior which is not "just a reflex" based on sensory input, allowing for potentially complex multi-epoch behaviors.

Internal state is denoted simply \(state\) in the graph.

On the other hand an eater has 4 possible sensory inputs states denoted \(perc\) (enumerated from 0 to 3), which encode what is right in front of the eater:

  • Wall (0)
  • Eater (1)
  • Empty (2)
  • Plant (3)

So there are \(16*4 = 64\) internal state / input state pairs or `full states', which are all the possible situations an eater could find itself into considering they only see 1 cell at a time.

For each full state pair the genome prescribes an action to perform among the 4 possible actions denoted \(whatToDo\):

  • Turn left (0)
  • Turn right (1)
  • Go forward (2)
  • Go back (3)

Lastly a new internal state to transition to denoted \(newState\) is also prescribed, which will be used on the next iteration.

Note that the \(64\) possible full states are fixed, while what the genetic algorithm evolves here is essentially a set of \(64 * 2 = 128\) numbers (2 since one is for the `action' and one for the `newState'), which are tuned to modify behavior

Trace plot

Best genome plot

This panel shows the saved simulation settings.
Each row of the table shows in green settings which match with the one currently loaded in the workbench, and in orange those which differ.
By clicking on the button at the begining of the row a dropdown will appear, from which you can:

  • Load the preset to current workbench (one at a time)
  • Load the preset to the experiment bank
    • Once loaded the row will be highlighted in light blue
    • You can remove a preset from the experiment bank by clicking on the yellow button with its name in the 'Experiment' panel below
    • You can load multiple presets to the experiment bank
  • Delete the preset
Strictly speaking you are not allowed to modify presets, if you need to edit some because you made a mistake:
  1. load the preset to the workbench
  2. delete the preset from the saved list
  3. make the changes in the workbench panel
  4. save it again
You cannot act on the presets while an experiment is running

Selected settings

Experiments parameters


This panel allows you to conduct an experiment involving some of your saved settings presets.
You can choose the presets from the 'Saved settings' panel by using the 'load-to-exp' button in the row dropdown.
Selected presets will appear below in the 'Selected settings' section.
You can remove presets from the selection bank by clicking on their yellow button, where the name is shown.
Once your selection is final regulate the 'Experiment parameters' and hit 'Run Experiment'.


Note that since the Genetic Algorithm involves randomness in both initialization and adaptation, each preset will be repeated multiple times, according to the 'Repetitions' parameter to obtain reliable results, so the experiment may take a while to complete.
For each preset a progress bar indicated completion of the current run, while the other indicates overall completion of the repetitions.


Once you hit 'Run Experiment' the application enters the running state:

  • you will see a green spinning circle in the top right corner
  • you can interrupt the experiment by clicking on 'Abort Experiment'
  • most of the controls will be disabled until the exp. finishes

If an experiment has just terminated:

  • you will see a yellow growing circle in the top right corner, this means there are unsaved experiment results.
  • you can save the results with 'Save results' under a new name.
    • saved experiment results will appear in the 'Saved Experiments' panel
    • if you save the results the status indicator in the top right corner will turn green indicating that you can safely reset the experiment without data loss.
    • you still need to hit 'Reset experiment' after saving to go back to idle state
  • Alternatively you can choose to discard the experiment results by hitting 'Reset experiment' directly, the application will go back to idle state

This panel shows the saved simulation settings.

Here you can see your collection of saved experiments.

You can expand/collapse each experiment result panel individually, plot their results again,
or if no experiment is currently running load the same configuration to the experiment panel to repeat of modify the experiment.

By clicking on the arrows in the panel header of an experiment you can move them up and down, this can be useful if you want to bring closer two experiments you are comparing.

For each saved experiment a table with all the parameters and results is shown.
Note that the color code of an entry here indicates if that column's independent variable was varied or fixed in the experiment.
Dependent variables and presetLabel(s) are not color-coded.

You cannot act on the presets while an experiment is running