Suppose you have 1001 animals in your region. It looks to me like:
The range fills up with numbers up to 500 or 501 depending on rounding.
Then animal 1 interacts with animal 2.
I think the intended next step is for animal 3 to interact with animal 4, and so on.
At that point, depending on which way the rounding went we could either:
Stop when animal 999 interacts with animal 1000. Animal 1001 won’t interact with anything, and will die by default.
Attempt to have animal 1001 interact with animal 1002. In languages I know this would lead to an error (when you try to pull element 1002 out of a 1001-element array). Does this actually work as-intended in Lisp?
On looking at this in more detail, though, I’m worried that what actually happens is that animal 1 interacts with animal 2, then animal 2 interacts again with animal 3, then animal 3 with animal 4, and so on through animal 500 interacting with animal 501, and then animals 502-1001 do not interact with anything and just die?
I’d imagine that the code should instead use 2i and 2i + 1 instead of i and i + 1 to index into the population, but I don’t actually know Lisp and maybe I’m misunderstanding how loops/increments work.
Hm. I’m looking at the code and I don’t quite understand how it works (argh, Lisp). Is anyone able to explain what’s going on here:
Suppose you have 1001 animals in your region. It looks to me like:
The range fills up with numbers up to 500 or 501 depending on rounding.
Then animal 1 interacts with animal 2.
I think the intended next step is for animal 3 to interact with animal 4, and so on.
At that point, depending on which way the rounding went we could either:
Stop when animal 999 interacts with animal 1000. Animal 1001 won’t interact with anything, and will die by default.
Attempt to have animal 1001 interact with animal 1002. In languages I know this would lead to an error (when you try to pull element 1002 out of a 1001-element array). Does this actually work as-intended in Lisp?
On looking at this in more detail, though, I’m worried that what actually happens is that animal 1 interacts with animal 2, then animal 2 interacts again with animal 3, then animal 3 with animal 4, and so on through animal 500 interacting with animal 501, and then animals 502-1001 do not interact with anything and just die?
I’d imagine that the code should instead use 2i and 2i + 1 instead of i and i + 1 to index into the population, but I don’t actually know Lisp and maybe I’m misunderstanding how loops/increments work.
So that’s why it’s been so hard for herbivores to colonize new biomes. Thank you aphyer. I have fixed both bugs.