Clustering Exploration…people in park, slime mold and software

For clustering theory assignment I found interesting looking at how people stand in the grass field while they take their dogs to a zone in prospect park.

I have noticed that they (And I) have a tendency to gather in groups while the dogs have their fun being out of leash. This groups change position around the grass field, they also change in number of groups and the size they have.

I for instance do not stay in a group for very long, I don’t like to stay and chat with people for long, I rather keep walking. I have realized that I go into groups for a while, just so my dog can have some time close to other dogs, the dogs of the people in the group. Fortunately my dog doesn’t like groups that much either and she walks along pretty fast, and we keep going our way.

The the distribution and the tendencies of forming groups (clusters) caught my attention so I began to take note on the position where people stand and huddle into groups (clusters). At first I thought that they stayed relatively near the garbage can, but that doesn’t seem a steady tendency. The groups change their position every day (that I have gone), but positions are repeated. I thought it might depend on where the first person arrives and decides to stay (but getting that early in the morning was difficult)…

Meanwhile I have been reading “turtles, termites and traffic jams”, by Mitchell Resnick. Its about parallel microworlds, parallelism, emerging behavior and decentralized systems. One of the themes studied was slime molds, which were mentioned in class when entering the clustering subjects.

I then thought that may be the clusters of people are formed because of other reasons not conscious by the humans, but by the behavior of their dogs, and their sense of smell and this seemed a nice coupling with the slime mold and hormone trails behavior.

In the book (turtles, termites and traffic jams) a programming language for exploring microworlds called StarLogo, it describes a language to program models and study the emerging behaviors of systems based on decentralized entities by having many individuals and simulating by parallel computation, which seams very much like Object Oriented programming.

So this exercise turned into a programming adventure, recreating the structure and capabilities of the StarLogo programing language.

So there is a BitByBitCluster class, an Entity class and a Terrain class. The Entities react to the conditions of their neighboring terrain (8 squares around it), the Entities have a position y direction, way to decide where to, sense of smell, and a set pheromone in terrain function. The Entities move in the direction of the gradient of pheromone around them at a more higher probability than walking in a random direction.

The terrain spreads it pheromone and it also evaporates.

So in the program the variables can be changed to explore different behaviors

int numE=700;//number of entities
int resolution=100;//number of terrain in total is resolution^2
int distribution=0;// to draw accordingly =width/resolution
int mode=0;//0 all sides smell, 1 only sides no diagonal smells
float pher=50; // pheromone the entities give each time
float maxSmell=pher*9.5f;//min smell to be relevant to move in that direction, higher sense of smell

float difuse=0.1f;//Diffusion rate of terrain
float evap = 0.99f;//evaporation rate of terrain

The values showed are from the program showed in the last picture of the gallery of pictures.

Various parameter where tried giving the different results shown in the gallery of pictures. The evaporation and tuning of the sense of smell made the most difference and how clusters where formed, but they where in relation with the amount of pheromone being imputed on each terrain, and the diffusion rate.

Playing with these values can give you interesting results, that resulted in an interesting (fun) to watch emerging behavior (that I remember every day when I go to the park). I found the simulations of microworlds to have a very good resemblance to the real behavior of people with dogs clustering behavior in the park. I am really interested in decentralized systems and will do more work relating to them in the future.

The program was made in processing and eclipse, with the proclipsing plugin.

I encourage to try the program, download the java files here, download the eclipse Archive File, zip file here, to mount the project.

(NOTE: for future work on this program the sides have to be programed so that the emerge on the opposite side where they are going through, right now the entities are in a terrarium like world, with walls on the sides.)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s