Advertisement

ants behaviour

Started by May 06, 2002 08:17 PM
28 comments, last by zip7000 22 years, 6 months ago
great!!
thank you very much!!!!! Note that for the scent dispersion I use a time function. every ten loops, the quantity of pheromon decrements by one.(quantity>0)

Two things :
I dont remember exactly the actual facts, as I have read the book a while ago, but here is a way it can be done.
When looking for food, the ant leave a light trail of pheromones, until it find food.
Then, depending on how much food has been found, the ant goes back to the nest, marking its trail again, with an intensity depending on the amount of food found.
When an ant find an existing path and is in wandering mode, it has two choices : follow the trail and see what''s there, or follow your own path. The probability for following the trail increase with the intensity of the trace.
Note that the pheromone must evapourate gradually ! Not totally after a while, but a little bit every unit of time.
I have some ideas about what would happen, but I must say without a picture it''s hard to explain.

Second, how do you know you are going home or towards the food ?
Simply put, ants dont look just in front of them, they also know which way they are facing. So you just need to have a method to figure out which way is your nest, because really, you dont care where you are goind when you are in "wandering mode", and you dont really care either when you are following a trail. Using a fixed reference point, like the sun, would help, I guess (I should check out my book again).

Ah, and something very cool that you can try :
create a world (tile based), with cells containing food spread randomly. Then put a few randomly placed, randomly moving "ants".
(ants can walk on cells containing food, but not on other ants).
They have only two rules :
-if I dont carry anything, if there is food in front of me, take food with probability of taking the food inversely proportional to the amount of food nearby (the more food against this piece of food we want, the less we want to take it).
-if we carry food and there is food around us, drop the food, with the probability of dropping the food proportional to the amount of food nearby (the more food, the more we want to drop the food we carry here).
It''s REALLY simple to implement, and the results should be pretty cool try it and behold the power of Emergent Behaviour !



Sancte Isidore ora pro nobis !
-----------------------------Sancte Isidore ora pro nobis !
Advertisement
quote: Original post by Anonymous Poster
Ants which do not adhere to the pheremone trail much, and vere off can be regarded as less intelligent (and maybe die off, allowing a genetic evolution of your colony to become stronger!)


No, cos those ants don''t reproduce.

quote: Original post by Anonymous Poster
Ants which do not adhere to the pheremone trail much, and vere off can be regarded as less intelligent (and maybe die off, allowing a genetic evolution of your colony to become stronger!)


Actually, you NEED ants that will vere off. That''s the power of ants : because one will try something different for no good reason, suddenly they will find something new. If they all followed each others blindly, they would all end up doing the same just like stupid lemmings.
It''s actually the ones that stray away that give the nest the potential for new discoveries (metaphorically and literally speaking).

Also be careful when you talk about genes and ants, remember that they are all born from a queen, and if my memory serves me well, workers only have half of the set of genes, I think they are all clones, actually, except the princes/princesses. (correct me if I am wrong, I am a bit rusty on myrmecology).

Also did anyone try my ants gathering routine ? I would love to know what you guys think. It''s a really cool emergent behaviour demo that I discovered in a programming article way before there was all that fuss about boids, and I still think it rules




Sancte Isidore ora pro nobis !
-----------------------------Sancte Isidore ora pro nobis !
interesting.

not enough strays == no discoveries.. not enough search of the problem space.

to many strays == to many discoveries.. not enough work done period.

wonder how it comes into balance.

quote: Original post by declspec
interesting.

not enough strays == no discoveries.. not enough search of the problem space.

to many strays == to many discoveries.. not enough work done period.

wonder how it comes into balance.

By hand tweaking the probabilities for straying, AFAIK.

That''s where you would actually start using GA : the probability of straying becomes a gene, and it''s value is adjusted according to how succesful a population of ants is.





Sancte Isidore ora pro nobis !
-----------------------------Sancte Isidore ora pro nobis !
Advertisement
quote: Also did anyone try my ants gathering routine ? I would love to know what you guys think. It''s a really cool emergent behaviour demo that I discovered in a programming article way before there was all that fuss about boids, and I still think it rules


I have a folder on my computer containing all the cool things like that which I want to try out, I''ve put yours in there, and I will probably do it tonight. Actually, this thread has inspired me to write my own little ant simulator .

One thing I have been thinking about the pheromone trail is that as time passes, they will disperse, thus the trail will become wider. As the trail gets wider, it will still allow the ants to follow it, but they will be more likely to deviate from it, thus a shorter path may be found.

Trying is the first step towards failure.
Trying is the first step towards failure.
quote: Original post by ragonastick
One thing I have been thinking about the pheromone trail is that as time passes, they will disperse, thus the trail will become wider. As the trail gets wider, it will still allow the ants to follow it, but they will be more likely to deviate from it, thus a shorter path may be found.
Trying is the first step towards failure.


It''s an interesting idea, but if you make the ants refresh the trail each time they use it, as I describe, then you''d have to be careful that the dispersion effect doesnt take place too fast.
I guess as long as you use the scent intensity thing I was on about it would not give too weird results.
Although it could be interesting to see what happens depending on the speed of dispersion and degradation of the scent...


Sancte Isidore ora pro nobis !
-----------------------------Sancte Isidore ora pro nobis !
I tried your thing last night, worked nicely. I like the fact that although none of the ants know where the pile is, they still manage to form a pile.

Which brings me to my next question - how else do ants communicate? What type of vision do ants have? If they see other ants without food walking away from an area, then will they be less likely to go that direction?

Trying is the first step towards failure.
Trying is the first step towards failure.
AFAIK, ants communicate thanks to there antennas. Each antenna''s segment is a chemical emittor/receptor.
They also exchange food (dunno the technical word in english) by, basically, kissing.
One type of ant, the honey pot, is an ant whose sole purpose in life is to fill itself with nectar to gigantic proportion until its body is so swollen the ant cant move anymore. Apparently, it''s lower abdomen part ressemble the face of an ant. This is because ants request food from each other by tapping on each other''s head more or less depending on how hungry they are. By ressembling an ant''s head, the honeypot''s ant''s back foold other ants into ''requesting food'', and get it. Pretty cool IMHO...
That would suggest that the other ants don''t have a clue about the mission of honeypot ants, they jsut treat them like the rest, unaware of theit special purpose (otherwise, why have a lower abdomen that ''strangely'' ressembles an ant''s head? ).

concerning the algorithm I described :
one cool thing would be to implement smell. food would emit a smell that''s more or less intense depending on distance and whose intensity increase with quantity. Movement of the ants could then be influenced by the strength of the smell, insteas of being purely random. Of course, it has to be a ''bit'' random, as otherwise we lose the ''stroke of genius'' effect that randomness provides.
We could also implement scent trails as I described in another post here, where the strength of the trail is dependent on the amount of food that was last discovered (In this case, it would be interesting to make all ants start from a nest).

concerning movements :
I mentioned movement based relative to the sun position. I think I talked about that because of bees, actually. Although I am still convinced ants had something too (i''ll have to check again). Bees signal presence of flowers, quantity, and distance, by dancing. the dance describes an infinity symbol, whose axis varies relative to the sun position to indicate the direction (I dont remember how they indicate the distance). The intensity of the dance indicates the amount of flower (basically, whoever dances the strongest, attract the most people).
IIRC, ants are aware of variation in the magnetic field, which basically would help them know which general way they are facing ?

Mmmmh ... I love ants ... did you ever look at ants cleaning up the entrance to their nest ? It''s pretty cool, no matter what you put to block the entrance, they all stop what they are doing to clean it up. I remember reading something about how they can move a very big obstacle by cooperating. The cooperation is actually an emergent behaviour. That is, when one ant has to move, say a little rock, it wont assess the situation, try to find the best angle before doing anything, or any of this forethinking we humans like so much. It will just go at it. If it doesnt move, it tries a different point of attack. If it still doesnt move, it request help from co workers, who basically go through the same cycle... until the damn thing moves. They dont synchronize movements, they just push or pull all at once, until something happens. And it usually does.

Pretty cool stuff, if you ask me


Sancte Isidore ora pro nobis !
-----------------------------Sancte Isidore ora pro nobis !

This topic is closed to new replies.

Advertisement