When energetic boy turtles (the big ones) interact with energetic girl turtles (the little ones), there is a possibility of love and a baby, whose color is a genetic blend of its parent's colors. Can you find the optimal blend of variables to maintain a stable population?
Approximately half of all turtles are male:
turtles-own [energy vision mobility male?]
In this model moving burns precious energy:
to move
rt random 360
fd mobility
dec-energy 1
end
Here's the mating ritual:
to interact [candidate]
let luck random 100
if luck < breeding-probability and
(ticks mod breed-every) = 0 and energy > min-mating-energy and [energy] of
candidate > min-mating-energy
[
dec-energy energy-consumed
ask candidate [dec-energy
energy-consumed]
ask patches in-radius vision [set
pcolor white]
hatch 1
[
init-turtle
set color ([color] of myself +
[color] of candidate) / 2
]
ask patches in-radius vision [set
pcolor black]
]
end
Here's the complete code: