Someone please correct me if my interpretation of food and reproduction are incorrect as my programing experience is limited.
I see the energy being reduced by 20%, but what is the threshold for death?
The number of offspring is determined by rolling a number between 0 and 1 rolled 10 * creature energy times, and for each random number less than 1 / (body size x 10), a baby is created with the same energy as the original creature and no impact on the original creature?
I think I am missing where predator efficiency is accounted for.
Not a Lisp expert, people can correct me if I am wrong, but:
Death is the default. If ‘reproduce’ is not called for an organism, it will not exist next iteration. If one organism kills the other, ‘reproduce’ is called only for the winner—if they both eat plants, ‘reproduce’ is called for both.
Predator efficiency seems as of this writing to be in lines 163⁄4 with the code you quoted, might have been added as a bug fix more recently?
What’s happening in the code you see if that the winner of the fight is being given as the first arg to the reproduce function (the animal that will reproduce), while the size (energy) of the loser is being given as the second arg. The size of the winner will be taken into account in the reproduce function.
Someone please correct me if my interpretation of food and reproduction are incorrect as my programing experience is limited.
I see the energy being reduced by 20%, but what is the threshold for death?
The number of offspring is determined by rolling a number between 0 and 1 rolled 10 * creature energy times, and for each random number less than 1 / (body size x 10), a baby is created with the same energy as the original creature and no impact on the original creature?
I think I am missing where predator efficiency is accounted for.
In line 163/164:
(reproduce (. [organism-0 organism-1] [fight-flight-result]
(energy-of (. [organism-1 organism-1] [fight-flight-result])
does this mean reproduction of organism-1 and organism-0 is only dependent on the body size of organism-1? no impact of stored energy?
The code you’re looking at has a bug. I fixed the bug. Here is the new code.
Not a Lisp expert, people can correct me if I am wrong, but:
Death is the default. If ‘reproduce’ is not called for an organism, it will not exist next iteration. If one organism kills the other, ‘reproduce’ is called only for the winner—if they both eat plants, ‘reproduce’ is called for both.
Predator efficiency seems as of this writing to be in lines 163⁄4 with the code you quoted, might have been added as a bug fix more recently?
What’s happening in the code you see if that the winner of the fight is being given as the first arg to the reproduce function (the animal that will reproduce), while the size (energy) of the loser is being given as the second arg. The size of the winner will be taken into account in the reproduce function.
This is correct. No organism ever survives a round. It must replace itself with a baby. An organism/species with no babies dies out instantly.
Thanks for the explanation.