The next step in our visualisation of agent based models is a simple flocking example.
This model is an attempt to mimic the flocking of birds, while the resulting motion also resembles schools of fish. The flocks that appear in this model are not created or led in any way by special leader rather, each bird is following exactly the same set of rules, from which flocks emerge.
We have exported the model into 3D Max providing the visualisation below, as ever these are early days but the results seem to run well with 300 ‘birds’ over 1000 frames. The birds are rendered as cubes at the moment for proof of concept:
Flocking in NetLogo exported to 3D Max from digitalurban on Vimeo.
Music “Funkmelon Blooz” (Electronica)
The birds follow three rules: “alignment”, “separation”, and “cohesion”. “Alignment” means that a bird tends to turn so that it is moving in the same direction that nearby birds are moving. “Separation” means that a bird will turn to avoid another bird which gets too close. “Cohesion” means that a bird will move towards other nearby birds (unless another bird is too close). When two birds are too close, the “separation” rule overrides the other two, which are deactivated until the minimum separation is achieved.
The three rules affect only the bird’s heading. Each bird always moves forward at the same constant speed.
If we were using the built in Crowd and Delegate system a true 3D flocking system would be possible, but it would be pure visualisation, by importing via NetLogo you gain access to the raw data and thus spatial analysis is possible. It is also quick to model and provides the best of both worlds – 3d visualisation and complex modelling.
How does this relate to the city? The next part is to put in real geographical data and to get the agents movies and reacting to each other on a spatial network, more on that to come.
You can download NetLogo from here, its comes with a excellent tutorial so you can start building your own model.