1 minute read

POLLINATION 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

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

Advertisement

;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 [ face one-of flowers in-radius 3 fd 1 if count flowers-here = 1 [ ask flowers-here [

;if there is a flower in proximity to the bee

;face the flower

;go forward 1 unit in its direction

;if bee lands on flower

;flower is polinated & set color 139 set polinated TRUE]

;color changes to pink

;set flower as polinated

;patch changes color for ease of later code ] ] [wiggle] set pcolor 58

;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 [ let flower-count count flowers with [polinated = TRUE] create-flowers 2 * flower-count [

;reproduce every 30 ticks

;count polinated flowers

;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: