NetLogo User Community Models
(back to the NetLogo User Community Models)
If clicking does not initiate a download, try right clicking or control clicking and choosing "Save" or "Download".
Try It in NetLogo Web
This program uses a genetic algorithm to evolve an optimal forager.
The foraging goal is find the most red pixels.
Agents are each given a genome which assigns values to three parameters:
2)on-food turniness and
Agents decide how much to turn by interpolating between on and off food
turniness, using their memory. If an agent has just seen food, it will turn
according to a tent function with a width equal to two times the value of the gene.
The tent function is always centered at the animals present heading. If an
agent hasn't seen food in a long time, then it will do the same using its
off food turniness gene. Agents use their memory depth gene to determine
how quickly they move from on food behavior to off food behavior. Agents with
a higher value, will behave as if they are near food for longer than agents
with a low memory depth value.
Agents are created for each new generation using a combination of better genomes from the last generation.
The "evolve" button does the following:
set generation (generation + 1)
if (generation > generations ) [stop]
compete: agents move around and collect resources by bumping into them.
do-best-of-generation-plot: plots the best harvest
grow-landscape: regrows the landscape to prepare it for the next generation
mate-recombine: this procedure only allows the best half of the agents to create offspring.
the offspring are the recombined genomes of these genomes.
mutate: this goes through genomes and randomly changes genes based on the mutation rate.
rebirth: this assigns genomes to new agents.
I'm sure I forgot a few things in explaining this, but that's basically what it does. There are
a lot of different assumptions that go into any genetic algorithm; I make different assumptions
on different days. There are still a few things I would like to fix but have never had the time
to do so. If you'd like to contact me, please do at firstname.lastname@example.org.
Created by Thomas Hills.