Braitenberg Vehicles: Networks on Wheels

A design and simulation environment for species of Braitenberg vehicle described by A.K Dewdney in his March 1987 "Computer Recreations" column in Scientific American. This document reports on the actual behavior of several of the vehicles in that article as well as the design and behavior of some additional models. The simulator, written in Java, can be downloaded.

The Model

Dewdney describes two kind of objects: light bulbs and vehicles.  Light bulbs are the simpler of the two objects.  They basically shine until they are broken.
Vehicles are more complex.  Each vehicle is a rolling platform on four wheels.  The front wheels do little except roll and keep the vehicle off of the ground.  The rear wheels are each driven by a small motor (one per wheel).  When a wheel's motor runs, the wheel turns.  When both motors run, the cart goes forward.  When neither motor runs, the cart stands still.  When only one motor runs, the cart will turn to the side.
Each vehicle also has a network containing some number (possibly zero) of nodes.  A node is something that has as input some number of pulses (from other nodes) and which may then output (to other nodes) a single pulse. Each node has an integer threshold.  If it receives at least that many input pulses from other nodes at the same time, then that node will "fire" a pulse on the next interval.
There are two ways that a pulse from one node will affect another node's "fire decision".  If the connection between the two nodes is an "excitatory" connection, then the pulse from the one node is added in with other pulses from other neurodes.  However, with an "inhibitory" connection, the pulse from one node will absolutely prevent the other neurode from firing.  Note that these nodes only work with integer values and that all nodes will test their inputs at regular intervals.
Each cart can also have light sensors, called receptors.  The closer a receptor is to a light bulb (or bulbs) the more light the receptor receives.  When a receptor has received a pre-specified amount of light over time, it sends out a pulse to some nodes.
To complete the vehicle's design, each of the wheel motors is connected to on of the nodes (or receptors) in the vehicle's network.  When the node connected to a motor fires, the motor will run during the next interval and the corresponding wheel will turn.  These vehicles then are driven by their networks and the input they receive from the immediate environment.  Light receptors fire in response to the proximity of a given color of light in a given direction,  networks of nodes process the input and the vehicles wheels will turn in response.

Simple Networks, Interesting Behaviors

To understand how interesting behaviors can be exhibited by even a simple network, look at some of the network designs proposed by Braitenburg and Dewdney.  I've named the networks after the color of the vehicle they drive in Dewdney's Scientific American article.  The simplest is the Yellow network.  By making minor changes to the Yellow network, we can derive the Red, Green and Blue networks, each exhibiting a very different behavior in the simulation runtime.

The Yellow Network

Schematic for the Yellow networkEach of the four networks has two light receptors.  The left receptor, labeled "R1" sees an arc from 60 degrees to the left of center to 20 degrees to the right of center.  The right receptor, labeled "R2" sees from 20 degrees to the left of center to 60 degrees to right of center. This gives the network the ability to distinguish between four situations:
  1. Light source directly ahead and "seen" by both receptors,
  2. Light source ahead and to the left and seen only by the left receptor,
  3. Light source ahead and to the right and seen only by the right receptor, and
  4. No light source ahead (receptors don't see anything), although there may be unseen light sources behind the vehicle.
There may also be combinations of the above scenarios.  For example, there may be nearby light ahead and to the left of the vehicle and a far light ahead and to the right of the vehicle.  In this case the left receptor will receive more light than will the right receptor and will therefore fire more frequently than will the right receptor.  Of course, when designing your own networks you may have as many receptors looking in any direction as you wish.  Fortunately for the beginner, two receptors are all that are needed to show how even a minor change in a network can result in a very different set of behavior.
The schematic diagram of the Yellow network above shows that each of the two receptors is connected to the motor turning the opposite wheel.  When the left receptor fire, the right wheel will turn and the left wheel will turn when the right receptor fire.  As a result, the Yellow network will turn the left wheel more often than the right when there is more light ahead and to the right of the vehicle  When the left wheel turns more often than the right, the cart will steer to the right - towards the brighter light of the right.  The converse is true when the stronger light is ahead and to the left.
In short, the Yellow network will drive the vehicle towards light.  When the light source is weak, the cart will move slowly since the receptors are firing less frequently.  When the light source is strong, the receptors fire more often and the vehicle will move more quickly.

The Red Network

The Red network schematicThe Red network is very similar to the Yellow network.  The receptors look for the same color light in the same directions.  The only difference between the networks is that the receptors in the Red network are connected to the wheels on their side of the vehicle.
Like the Yellow network, the Red network will drive the vehicle straight ahead towards a light directly in front of the vehicle.  In that case both receptors are firing at the same time and frequency causing the wheels to turn together.  When the light source appears off to one side of the vehicle however, only the receptor on that side will fire and only the wheel on that side will turn.  As a result, the vehicle will turn away from the light source.

The Green Network

The Green network schematic The Green network is a bit more complex than the Red network.  Each receptor is now connected to a node with threshhold 0 (zero) and the node is in turn connected to a wheel motor.  With a threshhold of 0, both nodes would normally fire continuously.  However, the connection between receptor and node is inhibitory: when the receptor fires, the node will not.
Remembering that the receptors will fire in the same way as the receptors in the Yellow and Red networks, lets walk through how a Green network will drive a vehicle in response to a distant light source.  With the light source far away, the receptors will fire infrequently, if at all.  As a result the nodes with threshhold 0 will not be inhibited and will fire almost continually.  In darkness the vehicle will move ahead quickly.  As the vehicle gets closer to the light source the receptors will fire more often and will inhibit the nodes more frequently.  With the motors running less and less, the vehicle will slow as it approaches the light.  If the light is directly ahead of the vehicle, the vehicle will eventually come to a complete stop at the point where the light is strong enough to cause the receptors to fie continuously.  However, if the light is far enough to the side of the vehicle so that it is seen by only one receptor, the other receptor will cease firing (and inhibiting its connected node), causing the vehicle to quickly turn until both receptors see the light and begin to fire at the same rate.
In short, like the Yellow network, the Green network will approach and veer towards a light from a great distance.  The Yellow network, however, will move slowly in darkness and quickly in light while the Green network will move quickly in darkness and stop in strong light.

The Blue Network

The Blue network schematicThe Blue network is very much like the Green network, except that receptors end up driving the motors on the opposite side of the vehicle.  Like the Green vehicle, Blue networks drive their vehicles quickly in darkness and slowly in bright light.  The two networks also behave the same way when dealing with a light source directly ahead.  The difference lies in their reaction to light sources off to one side or the other.  While the Green network will turn the vehicle towards the light, the "crossed connections" of the Blue networks results in the vehicle veering away form the light.

Other Networks

Dewdney described two other networks, one purple and the other orange, in which each of the nodes in a Blue or Green network, respectively, are replaced by four connected nodes that act to slow the vehicle in bright light.  Since the Java simulation environment shows positional and directional behaviors at the expense of speed behaviors, I have not included more of a description of these networks here.  If there is interest, though, I can include the Orange and Purple network definitions along with the other network definitions in the Java simulation.

Dave Chess, a fellow IBM'er, developed a surprisingly simple network that drives its vehicle in a continuous orbit around a light source.  The network description is included in the simulation package, but I challenge people to try to figure out how he did it (hint: use two nodes and one receptor).

I have developed a network I call the Lemming.  In darkness it travels ahead at full speed, but it will veer towards light.  The behavioral twist happens when the vehicle driven by this network is the same color that its receptors are looking for.  An interesting group behavior develops when 50 or more Lemming vehicles are put into the same simulation scenario.

The Environment and Vehicle Implementations

A vehicle simulation environment has been written in Java and can be downloaded. Java classes implement the various objects that participate in the simulation. By using these classes you can define your own vehciles as well as layout the simulation scenarios. For now you must write a simple Java application to run the simulations, but soon I hope to put an XML front-end on the environment.

A simple demo shows the actual individual vehicle behavior for three of Dewdney's vehicle networks (Yellow, Green and Blue). A slightly more complex demo shows the group behavior exhibited by Lemming vehicles.  The environment requires either the 1.1 Java Runtime Environment (JRE) or the 1.1 Java Development Kit (JDK).  The download page provides more information and links.

You can also browse the documentation for the Java classes

Related Topics

I have collected a set of links to related material .

Chris Gerken
Apex, NC

December 12, 1998