Is there a way to spawn turtles during simulation even if they died. In my simulation fish are eating plankton, so if they encounter plankton the plankton dies/gets eaten. However, when a fish can't eat plankton anymore it will die because it doesn't get energy from plankton anymore by eating it. So when all the fish have died the plankton should come back; due to migration etc. and grow immensively. I am not sure how to implement this? The create function doesn't work here, only in the setup.
to plankton-reproduce
if random-float 100 < reproduce-plankton [
set energy (energy / 2)
hatch 1 [setxy random-xcor random-ycor]
]
if count plankton < 10 [
create-plankton 20
setxy random-xcor random-ycor
]
error: you can't use create-plankton in a turtle context, because create-plankton is observer only