Pollination Simulation

Pollination Simulation preview image

1 collaborator

Default-person Mariya Lupandina (Author)

Tags

(This model has yet to be categorized with any tags)
Visible to everyone | Changeable by everyone
Model was written in NetLogo 6.2.2 • Viewed 67 times • Downloaded 7 times • Run 0 times
Download the 'Pollination Simulation' modelDownload this modelEmbed this model

Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)


Comments and Questions

Please start the discussion about this model! (You'll first need to log in.)

Click to Run Model

breed [bees bee]
breed [flowers flower]
breed [hives hive]
flowers-own [polinated
             age]

to setup
 clear-all
  ask patches [
    set pcolor 59                                                                 ;set patch color
   ]
 set-default-shape turtles "flower"

 create-flowers 10                                                                ;define a number of flowers
   ask flowers [
    set color white                                                               ;flowers are white
    set shape "flower"
    set size 3
    move-to one-of patches with [count flowers-here = 0 and count bees-here = 0 and count  hives-here = 0]  ;and also moves to a random patch where there are no bees
   ]

 create-bees number-of-bees                                                       ;when the simulation starts a certain number of bees are created
 ask bees [                                                                       ;bees are yellow
    set color yellow
    set shape "bee"
    set size 1.5
    move-to patch 0 0                                                             ;bees start in hive
   ]

 create-hives 1                                                                   ;create hive
 ask hives [
    set shape "hexagonal prism"
    set size 5
    move-to patch 0 0
  ]

 setup-plots
 reset-ticks
end 

to go
  if count flowers >= 900 [stop]                                                     ;simulation ends when all patches are occuped 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 bees-moveaway                                                                     ;bees to move away from polinated flower
  ask bees [
    if pcolor = 58 [
      rt random 360
      fd 3
     ]
  ]
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 [                                                                    ;breset pollination for the next cycle
      set polinated FALSE
      set color white
     ]
  ]
end 

to wiggle                                                                           ;move in a random direction directions
   fd 1
   rt random 50
   lt random 50
end 

There is only one version of this model, created about 1 year ago by Mariya Lupandina.

Attached files

File Type Description Last updated
Pollination Simulation.png preview Preview for 'Pollination Simulation' about 1 year ago, by Mariya Lupandina Download

This model does not have any ancestors.

This model does not have any descendants.