The Braitenberg Cockroach 4
(Growth and Decay)
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.
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.
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.
The vehicles are attracted to each other as sources and will tend to form into clusters over time.
Built with Processing