1 minute read

POLLINATION SIMULATION

academic / 2022 / NetLogo agent-base simulation

The Pollination Simulation was my first time experimenting with agent-based modeling and useing NetLogo. For the simulation, I created a simplified model to describe how the number of bees dictates the number of plants (in this case flowers) will grow from season to breed [bees bee] breed [flowers flower] breed [hives hive] flowers-own [polinated age] season. The number of bees is set up at the beginning and remains constant for the entirety of the model’s run. The model runs until the entire field is filled. To run this model, click here and then click on “Run in NetLogo Web.” to setup clear-all ask patches [ set pcolor 59 ;set patch color

Advertisement

] set-default-shape turtles “flower” end to go if count flowers >= 900 [stop]

;simulation ends when all patches are occupied with a flower if ticks > 400 [stop] ;simulation ends when tick count reaches greater than 400 bees-travel ;bees move around randomly until they locate flower bees-moveaway ;bees move away from flower when it’s polinanted flowers-reproduce ;flower reproduces if polinated tick end to bees-travel

;bees move around ask bees [ ifelse count flowers in-radius 3 > 0 [ ;if there is a flower in proximity to the bee face one-of flowers in-radius 3 ;face the flower fd 1 ;go forward 1 unit in its direction if count flowers-here = 1 [ ;if bee lands on flower ask flowers-here [ ;flower is polinated & set color 139 ;color changes to pink set polinated TRUE] ;set flower as polinated set pcolor 58 ;patch changes color for ease of later code

] ] [wiggle]

;otherwise if there are no flowers move in a random direction ] end to flowers-reproduce ;polinated flowers to reporduce if ticks > 0 and ticks mod 30 = 0 [ ;reproduce every 30 ticks let flower-count count flowers with [polinated = TRUE] ;count polinated flowers create-flowers 2 * flower-count [ ;create two new flowers for each polinated flower move-to one-of patches with [count flowers-here = 0 and count hives-here = 0] ;move to a random patch where there is no flower & no hive set color white set size 3

] ask flowers [ ;preset pollination for the next cycle set polinated FALSE set color white ] ] end following this link and click on “Run in NetLogo Web” to run the simulatin screen captures of model in action

This article is from: