Subject: New Born Foragers and Predators with genetic deficiences???
From: Pierre-Marcel GORAL (corran_pmg@hotmail.com)
Date: Mon Mar 15 2004 - 16:03:20 CET
Hem... Nevermind. Forget my morning mail, the problem is solved: My init procedures didn't recognize both of my agents, and Foragers weren't considered by the model as Foragers, disabling their IA. I've rewrote those procedures, and that's OK now. And they can be eaten by predators, dying in the process...
Cool, but there is another problem now: my newborn predators are strange, because they don't seem to move, hunt, eat and die! And I never had little new foragers... Too sad you think, but the problem that the implementation of the procedure "reproduce" come directly from the tutorial 2 of the site of the CIRAD, and is the same for foragers and predators... I think the new instances of agents are not took by account by the model, because first they are leguminates (aka deaf, blind and definitely stupid), and second they are!
not recognized by my probes tracking the size of the Vectors "thePredators" and "theForagers"... Quite strange...
Here is the implementation of the repoduce functions of both Predators and Foragers.
reproduce
"S'il a assez d'énergie, l'herbivore se reproduit, créant un nouveau semblable, et perdant l'énergie consacrée à cette reproduction (énergie de base du nouveau né)"
| newForager |
self energy > self class fertilityThreshold
ifTrue:
[ newForager := self class new.
newForager strategy: self strategy.
self energy: self energy - newForager energy.
newForager moveTo: self nearestEmptyLocation ].
^newForager
reproducePredator
"S'il a assez d'énergie, le prédateur se reproduit, créant un nouveau semblable, et perdant l'énergie consacrée à cette reproduction (énergie de base du nouveau né)"
| newPredator |
self energyPredator > self class fertilityThresholdPredator
ifTrue:
[ newPredator := self class new.
self energyPredator: self energyPredator - (newPredator energyPredator).
newPredator moveTo: self nearestEmptyLocation.].
^newPredator
It'll be nice of you if you pay attention to these problems. Thank you by advance!
Cordialement,
Pierre-Marcel GORAL