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.
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.