Braitenberg vehicle and 'Preditor/Prey' simulator


You are welcome to modify and use this code for non-commercial purposes providing you credit the origin (a web address is sufficient eg http://www.rdg.ac.uk/~shshawin/LN ). If you make any clever changes and are happy for these to be published on the web please let me know so that I can update the program. Written by William Harwin, Copyright W.S. Harwin 2002-2007.

This program uses opengl and the glut libraries to simulate a number of 3D wheeled robots that seek out light sources. At a basic level the robots can be braitenberg vehicles that is light seekers and light avoiders. But it is also possible to simulate predator prey interactions etc.

Paper on the theory of Braitenberg vehicles

Still needs to be written

Running under Linux

Your installation will need opengl (mesa) and the glut libraries. (these are called freeglut3-dev in synaptic)

Compile with g++ *.cpp -L/usr/local/lib -lglut -lGL -lGLU

Running under windows.

You will need the Glut32.dll either in the same directory as brait.exe or in the windows system directory.

Braitenberg Vehicles


Objects in the braitenberg world are

lights (food)

organisms
predators, prey, bright prey,
robots
shy lightseeker agress lightseeker shy lightphobe

Eye model


Eye model for braitenberg vehicles is Intensity = sum for all lights cos(angle_to_light)/dist^2 to light

Model for preditors and prey is simply to identify the nearest light (or prey) and turn towards it.

Robot Brains


Braitenberg robots are either direct gains between the eyemodel and the wheel motors, or an inverse gain of the form
Motorspeed= const1/(lightlevel+const2) -const3

Preditors and prey simply choose the nearest light and turn towards it.

Bright prey increases speed and heads in a random direction when near a preditor.

Dynamics of the robot


Commands avaliable while running


These are all very simple single letter commands. The Beasts/ Neuron controlled vehicles/N.C.V's can be added by clicking with the mouse when in edit mode. Simulation is begun when the space bar is pressed. To change lights into beasts use the <> keys, a grey dimple shows which beast is currently selected for editing.

Single letter commands are as follows

A list of keyboard commands: