Messages from list : cormas@cirad.fr

Choose a topic among the following archives :

RE : "step" conflict between agents?

New Message Reply Date view Thread view Subject view Author view

Subject: RE : "step" conflict between agents?
From: Christophe Le Page (christophe.le_page@cirad.fr)
Date: Mon Mar 15 2004 - 16:32:51 CET

 
Hello Pierre-Marcel,
 
Look at CormasModel>>stepDynPop:
This generic method is assuming that the basic behavior of your agents
is embedded into a method called "step" that is returning either a
newBorn agent, either 'nil' if no reproduction occurs.
 
Thus, if you wish to use it for predators as well as for preys, you
should keep the same name "step" as the general method for Predator and
Prey. And because this "step" method is sent, within "stepDynPop:", to
each elements of the collection given as argument, there is no need to
write loops over the collections of predators and preys in the main
"step:" method of your model.
 
Your main "step:" method should then simply have three instructions:
 
step: t
"Evolution des Ressources"
 super stepEntities: self thePlants.
"Evolution des Herbivores"
 super stepDynPop: self theForagers.
"Evolution des Predateurs"
 super stepDynPop: self thePredators

New Message Reply Date view Thread view Subject view Author view
 

Back to home