To view this content, you need to install Java from java.com

The Braitenberg Cockroach 4
(Growth and Decay)

Obstacles
There are now obstacles that the vehicles cannot get around. When a vehicle hits an obstacle it changes direction.
If a vehicle gets stuck on an obstacle it will wiggle free.

Vehicle Generation
The population of vehicles starts at 10.
Every time 2 vehicles collide a new vehicle is generated.
When vehicles collide, a small yellow burst is generated at the point of contact.

Population Control
If there are 30 vehicles then the population has maxed out and needs to reduce itself.
A vehicle will be removed every 2 seconds until there are only 10 left on the stage.
Once this equilibrium is attained the vehicles once again begin multiplying when they collide.

Sources
The vehicles are attracted to each other as sources and will tend to form into clusters over time.

By Aaron Levisohn

Source code: braitenberg_5 myVehicleClass myWheelClass obstacleClass vehicleClass wheelClass

Built with Processing