



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




Try different placements for the food sources. What happens if two food sources are equidistant from the nest? When that happens in the real world, ant colonies typically exploit one source then the other (not at the same time). I changed the code so that there were 2 food patches (east and west) equal distance from the nest with 100 creatures. Please see graphics below. This was easily done by using the same code “((distance (0.6 * screen-half-width) 0) < 4)” and by leaving the code unchanged for the east side of the world and then changing to -0.6 for the west side of the world. Unfortunately, I have no way to actually count the number of creatures exploiting either food source. However, visually it appeared that both food sources had about the same number of creatures going too and from it. Since I was not able to definitively count the number of creatures exploiting either food source I decided to run the same code 14 times too see if the average length of time for the food sources to be depleted was the same for either side. I also paid attention to which food source was found first during each trial. I tried to modify the code so that it would indicate to me exactly when either food source was completely depleted; unfortunately I was not able to get the code to function correctly. I then decided to closely observe which side the food source completely disappeared first. This was difficult because sometimes there were so many creatures around the food source that they obscured the food source still lying on the ground. Finally I decided to observe not only when the food disappeared but also when the pheromone trail began dissipating from either food source. As mentioned previously, the creatures appeared to exploit both food sources at approximately the same time. However most of the time one of the food source was depleted slightly before the other. Out of the 14 trials 8 times the food source to the west of the nest was depleted first, 5 times the food source to the east was depleted first. 1 time it appeared that both food sources were depleted at the same time. It appears that most of the time which ever food source was found first was the one that depleted slightly before the other one. However there were a couple of trials where the food source that was found first was not the food source depleted first. During most trials there were approximately 25 - 30 creatures that were wandering around the world not involved with the gathering of the food from either food source. This count was made when I visually observed the maximum number of creatures Food source found first Food source depleted first, by a few seconds 1 food item remaining
If I continue to lower the number of creatures eventually it would be below the critical creature density necessary to support two food sources at the same time and there would be a dramatic difference between which of the two food sources was depleted first. I also feel the critical creature density of multiple food sources being gathered at the same time is directly related to the equidistance of the food sources from the nest. Further away means there needs to be more creatures to support equal gathering. In this project, the ants use a "trick" to find their way back to the nest: they follow the "nest scent." Real ants use a variety of different approaches to find their way back to the nest. Try to implement some alternative strategies. The first modification I made was to remove the “wiggle” procedure call from “return-to-nest” procedure. I did this in hopes of removing all randomness from the creature’s movement when they are carrying food. What I thought would happen is the creatures would go directly to the nest without any unnecessary steps. However, what ended up happening is that the creatures would pickup the food and sometimes step in the wrong direction (not towards the nest). This happened previously (with the wiggle), but the creature would correct itself and step towards the nest, but what was different is that this time (without the wiggle) the creatures would continue to step in the wrong direction and never find the nest. With 100 creatures even after the food sources were completely depleted I still had numerous creatures carrying food along the outer perimeter of the world. They would leave one side and reenter on the other. The rest of the creatures were following the creatures carrying the food. Please see graphic below. I let the code run for 20 minutes and the creatures carrying the food never found the nest. It appears that the creatures look straight ahead, then right 45 degrees and finally left 90 degrees in the “uphill-nest-scent” procedure to search for the nest. An easy modification I made to the code was to increase the number of sniffs the creature performed. I changed the code so the creature would sniff in 5 directions: 90 degrees to both sides, 45 degrees to both sides and straight ahead. I intentionally omitted the “sniff” code from this write-up because I feel the modification is straight forward and can be easily reproduced. I was hopping this would increase the ability of the creatures to locate and find the nest. I ran the original 3 sniff version and the new 5 sniff version side by side with 100 creatures each. Please see graphic below. I started them at the same time. Most Creatures leave at top Creatures enter at bottom Results from “wiggle” removed
of the time it appeared that there were more creatures involved in the pheromone trail with the new 5 sniff version however, the food source was depleted quicker in the original 3 sniff version. It seems as though all of the extra sniffs was just a waist of time and the original 3 sniff version was sufficient to get the creatures from the food source back to the nest quickly. Another change I made was for the creatures to “see” the nest from anywhere in the world. I created a procedure in that once the creature found the food it checked its relative position and moved towards the nest. I compared this version to the original version (where the creature checks the 3 positions and moves towards the one with the highest scent). In the newly revised “homing beacon” version the creatures were much more efficient at returning to the nest after picking up a food item than in the original version. Please see graphic below. Given that in the original version the creatures were already able to “sense” where the nest was from any location in the world the change to the code should not have affected the performance of gathering food. However, my guess is that it took longer to deplete the food sources in the original unaltered version because the extra code from their relative position to the nest in the “uphill-nest-scent” slowed the execution down just enough so that the revised “see” version ended up being faster in depleting all of the food sources. Notice indirect path to nest 5 sniff version 3 sniff version as result of too many sniffs creatures can “see” nest version Default “uphill-nest-scent” version 5 sniff version started approx. 1 second before 3 sniff version Default version started approx. 1 second before “see” version