Courses/CS 461/Winter 2006/Firouz Bharthania/week 2

From CSWiki

Jump to: navigation, search

[edit] Ants Line

  • The interesting phenomena which emerges in this model is that the circuitous path on which the leader or the first few ants walk over becomes more and more smoothened and flattened as more ants starts going (the shortest path to the food !!!)
  • The leader ant wiggles and forwards a little bit in each step.The second ant starts following the leader after a while and adjusts it's heading toward it's leader at each step. The same procedure applies to the rest of the ants, each one following the one ahead.
  • The leader ant's path is very circuitous, non smooth and zig zag like.But the second ant following the leader amazingly creates a much smoother curve. The secrete lies in the distance that is between the leader and it's following one which is the second ant. As illustrated in Figure 1 , in cycle 1 the leader ant is located at point a1, the second ant at point b1 and the third one at c1.Even if the leader ant wants to make a sharp 90 degree turn in second cycle, still the second ant needs to turn very little (alpha angle) to adjust it's heading toward it's leader and for the third ant this angle becomes even smaller (beta angle).

Figure 1

Hence each ant follows a smoother path than it's preceding ant (Figure 2). In the following figure, the colors red, green, orange, gray and blue indicate the path taken by first, second, third, fourth and last ant respectively.

Figure 2

Another point is that as two ants get closer to each other, the turning angle of the following ant gets more closer to the one of it's leader.After a while the path gets closed to a straight line between the nest and the food.

[edit] Wealth

  • This model demonstrates the Pareto's law (for many phenomena 80% of consequences stem from 20% of the causes) and also the famous saying that the reach gets reacher and the poor gets poorer.

Although at the first, the wealth (grains) and the turtles are distributed randomly, after a while turtles form three clusters of population based on their wealth.
1- poor : most populated group having less than 1/3 of the richest turtle's wealth.
2- medium : less populated group having less than 2/3 and more than 1/3 of the richest turtle's wealth.
3- rich : the least populated group having more than 2/3 of the richest turtle's wealth.

  • The grains are distributed in patches roughly equal. Turtles consume some amount of grains in their patch based on their metabolism factor and then move toward the patches that are in their view radius and have the most grains. If the number of grains in a patch is less than the maximum number of patches allowed for that patch then some new grains will grow in there till it reaches it's maximum value. If more than one turtle is presented in a patch at a time, they will divide the grain among themselves. But as the turtle moves it looses some amount of energy based on it's metabolism. Also if a turtle reaches it's maximum allowed age it dies and a new turtle is born in that place holding a random amount of wealth and metabolism.
  • Surprisingly the law happens to be true for most of the settings !!!

We might be able to get the population of different groups closer to each other a little bit by changing some of the settings but generally there are always three different populations with the mentioned specifications. At first I thought the reason for the huge poor population is that they don't have enough energy to go and get more food, so they die early. In order to check it I added 6 variable as follow:

       poor_wealth_die :    number of poor turtles died because of no energy
       medium_wealth_die :  number of medium turtles died because of no energy
       rich_wealth_die :    number of rich turtles died because of no energy
poor_age_die : number of poor turtles died because of their age medium_age_die : number of medium turtles died because of their age rich_age_die : number of rich turtles died because of their age

I watched them as they grew. With default settings it seemed that the reason I mentioned earlier was correct (the poor turtles were dying because of not having energy) but surprisingly the story changed by using different settings. For example in one situation no poor turtle was dying because of lack of energy but still the law was holding.

After playing with different settings and also making some changes in the program I found out that the reason for this emergent is that at different time intervals, there are a few lucky turtles which are located in grain reach areas.

I think the only way we can prevent this phenomena from happening is to distribute equal amount of grain in each cell, placing just one turtle in each cell, assigning each turtle the same metabolism and maximum age and preventing turtles from overlaping each other. This is an ideal situation which distribute every thing equally and does not happen in real world.

[edit] Boiling

  • The phenomena that emerges running this model is something similar to what happens for boiling water.
  • Each patch receives a definite amount of heat. When it's temperature reaches the boiling temperature, the bobble bursts and the temperature of that patch drops to zero. If the temperature of all neighbors of a patch are 212, the temperature of the patch is set to 213 which causes the patch to boil. Hence it's temperature drops to zero and in the next cycle affects it's neighbors temperature.
  • This model is a simple cellular automata. What happens is that each patch has effect on it's neighbors in getting the heat from the hotter ones while it's reaching the boiling temperature or when it's temperature has dropped because of passing the boiling temperature; or in turn giving it's cooler neighbors some of it's heat.

There is an interesting thing happening here. In the first few cycles the Average heat of the liquid rises and then suddenly drop a significant amount reaching almost the room temperature. Then again raises and drops, but as it goes on the range of the changes gets smaller. The reason is that at the few first raises, a huge amount of the liquid obtains more or less the same temperature. I think this is an error in the model, because it assumes that each patch is receiving the same amount of heat, but in reality this can not happen easily. If we change the code so that the amount of heat each patch receives differs even as little as 0.1 of a degree, the first drop and raise won't have those amazing ranges.

Personal tools