Community interaction-Mutually beneficial

Community interaction-Mutually beneficial preview image

1 collaborator

Screen_shot_2018-02-02_at_12.53.50_pm lin xiang (Author)

Tags

Visible to everyone | Changeable by the author
Model was written in NetLogo 6.2.2 • Viewed 118 times • Downloaded 13 times • Run 0 times
Download the 'Community interaction-Mutually beneficial' modelDownload this modelEmbed this model

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


WHAT IS IT?

This model simulates the interaction of mutually beneficial between bees and sunflowers.

HOW IT WORKS

Agents:

There are two types of agents: bees and sunflowers.

Model Rules:

  1. There are 165 patches in the model. The nutrients in each patch may support and only support one sunflower plant.

  2. Bees lose energy when they move around to search for flowers and die when running out of energy.

  3. Bees gain energy when they find flowers and will produce offspring when they accumulate enough energy.

  4. Bees pollinate the sunflowers, and only the pollinated flowers produce seeds.

  5. Spraying Insecticide kills bees.

  6. Urbanization reduces the area of sunflower patches.

HOW TO USE IT

  1. Use sliders number-of-plants and other similar sliders to set up the number of organisms. Click Start/Reset to confirm the settings.

  2. Put a number in years to define when the model ends.

  3. Click Run/Pause to run or pause the model. Good for gaining an overview and a long-term result.

  4. Click Run a year to run the model for a hypothetical year. Good for systematically collecting data.

  5. Use Urbanization and Rewild to change the area of sunflower patches

  6. Use Bees-killed-by-insecticides to define how many bees are killed by insecticides.

THINGS TO TRY

  • What population patterns emerge when neither urbanization nor insecticides are present in the model?

  • What population patterns emerge when urbanization is present in the model?

  • What population patterns emerge when insecticides are sprayed in the model?

  • How do urbanization and/or insecticide utilization affect the yields of oil and honey in the model?

RELATED MODELS

Find more community interaction models at http://3dsciencemodeling.com

CREDITS AND REFERENCES

Dr. Lin Xiang (lin.xiang@uky.edu) created this module at the University of Kentucky in 2022. If you mention this model in a publication, we ask that you include the citations below.

Xiang, L. (2022). Mutually Beneficial Interaction. Department of STEM Education, University of Kentucky, Lexington, KY.

Comments and Questions

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

Click to Run Model

; Coded in 2022 by Lin Xiang; Last revised in 2022 by Lin Xiang (lxiang75@gmail.com; lin.xiang@uky.edu)
;;
;; If you mention this model in a publication, we ask that you include the citations below.
;;
;; Xiang, L. (2022). Mutually Beneficial Interaction. Department of STEM Education, University of Kentucky, Lexington, KY.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


breed [legends legend]
breed [plant1s plant1]
breed [pesticides pesticide]
breed [buildings building]
breed [bees bee]

plant1s-own [visit-1 num-seed nectar]
bees-own [life erg food ]
patches-own [seeding bldg]
Globals [days num-seeds

  running-avg-list-bee running-avg-list-plant1
  mean-total-bee mean-total-plant1

  oil
  honey

]

to-report empty-patches
  report patches with [pcolor >= 62 and seeding = 0 and bldg = 0 and not any? plant1s-here]
end 

to-report fresh-flowers
  report plant1s with [nectar > 0 and visit-1 < 2 and shape = "sunflower-1"]
end 

to-report building-land
  report patches with [pxcor > min-pxcor and pxcor < max-pxcor and pcolor = 62 and bldg = 0]
end 

to setup
  clear-all
  setup-patches
  setup-legends
  setup-plant1s
  setup-bees


  set running-avg-list-bee []
  set running-avg-list-plant1 []

  set oil 0
  set honey 0

  do-plot
  reset-ticks
end 

to setup-patches
  ask patches [set pcolor 62]
  ask patches with [pycor < 2 or pycor = max-pycor or pxcor = 0 or pxcor = max-pxcor] [set pcolor white]
  ask patches with [pcolor = 62] [set seeding 0 set bldg 0]
end 

to setup-bees

  set-default-shape bees "bee"

    create-bees number-of-bees
    [set color yellow
     set size 0.6
     set erg 10
     set life 0
     setxy 1 + random (world-width - 2)  2 + random (world-height - 3)
    ]
end 

to setup-plant1s
  ask n-of number-of-sunflowers empty-patches
    [sprout-plant1s 1
    [set color 26
    set size 1
    set shape "sunflower-1"
    set visit-1 0
    set nectar 1
  ]]
end 




;;;;;;;;;;;;;;;;;;;;;
;;   GO PROCEDURE  ;;
;;;;;;;;;;;;;;;;;;;;;

to go
; every 0.01[

 if ticks >= years: * 60 [stop]

  search
  reproduce-bees
  make-nectar
  flower-color
  plant-reproduction
  pesticides-killing
  find-running-avg-1
  ifelse days <= 9 [set days days + 1] [set days 0]
  do-plot
  tick
;]
  if mean-total-plant1 = 0 and mean-total-bee <= 0 [stop]
end 

;;;;;;;;;;;;;;;;;;;;;;;;;;

to search
ask bees
  [ifelse any? fresh-flowers in-radius 2
     [let my-goal one-of fresh-flowers in-radius 2
      face my-goal
      move-to my-goal
      set erg erg + 3
      ask my-goal [set nectar 0 set visit-1 visit-1 + 1]]
     [right random 180 left random 180 if [pcolor] of patch-at dx dy = 62 [fd 1 set erg erg - 0.5 if erg <= 0 [die]]]

     ifelse life < 60 [set life life + 1][die]  ;set life-span to allow trapped bees to die out
  ]
end 

to harvest-honey
  ifelse count bees > 35
  [set honey 0.1 * (sum [erg] of bees * (20 / 100))
    ask bees [set erg erg * (80 / 100)]]
  [set honey 0]
end 

to reproduce-bees
  ask bees
    [if erg >= 20
      [hatch 1 [set erg 10 set life 0]
       set erg erg - 10]]
end 

to plant-reproduction
  if days = 9
    [ifelse count plant1s with [visit-1 = 2] > count patches with [pcolor = 62] / 2
      [set oil (count plant1s with [visit-1 = 2] - count patches with [pcolor = 62] / 2) / 2 set num-seeds count patches with [pcolor = 62] / 2]  ;harvest sunflower oil
      [set num-seeds count plant1s with [visit-1 = 2]]

      ask up-to-n-of (2 * num-seeds) patches with [pcolor = 62 and seeding = 0]
        [set seeding 1]

        ask plant1s [die]

    ask patches with [seeding = 1]
      [if bldg = 0
          [if random 100 < 85
            [sprout-plant1s 1
             [set color 26
              set size 1
              set shape "sunflower-1"
              set visit-1 0
                set nectar 1]]]
        set seeding 0]



    harvest-honey
  ]
end 

to make-nectar
  ask plant1s with [nectar = 0 and visit-1 < 2]
  [if random 100 < 15    ;produce food at a chance
    [set nectar 1]]
end 

to  flower-color
  ask plant1s with [visit-1 >= 2 and shape = "sunflower-1"]
  [set color 35 set shape "sunflower"]
end 

to find-running-avg-1   ;find the running average
   (ifelse
    ticks < 30
     [set running-avg-list-bee lput (count bees) running-avg-list-bee set mean-total-bee mean running-avg-list-bee
      set running-avg-list-plant1 lput (count plant1s) running-avg-list-plant1 set mean-total-plant1 mean running-avg-list-plant1
    ]

     [set running-avg-list-bee lput count bees running-avg-list-bee set running-avg-list-bee remove-item 0 running-avg-list-bee set mean-total-bee mean running-avg-list-bee
      set running-avg-list-plant1 lput count plant1s running-avg-list-plant1 set running-avg-list-plant1 remove-item 0 running-avg-list-plant1 set mean-total-plant1 mean running-avg-list-plant1
  ])
end 

to deconstruction-1
if any? buildings
  [ask one-of buildings with [pycor = max [pycor] of buildings]
    [ask neighbors with [bldg = 1] [set bldg 0 set pcolor 62] set bldg 0 set pcolor 62 die]]
end 

to deconstruction
if any? buildings
  [let demolishing buildings with [pycor = max [pycor] of buildings]
    ask one-of demolishing with [pxcor = max [pxcor] of demolishing]
    [ask neighbors with [bldg = 1] [set bldg 0 set pcolor 62] set bldg 0 set pcolor 62 die]]
end 

to building-a-house
    if any? plant1s-here [ask plant1s-here [die]]

    sprout-buildings 1
      [set shape "house-1"
       set size 2
       set color 48
       setxy pxcor - 0.5 pycor
     ]

    set bldg 1 set pcolor 62.5

    ask neighbors with [pcolor = 62]
      [if any? plant1s-here [ask plant1s-here [die]]
          set bldg 1 set pcolor 62.5]
end 

to pesticides-killing

   ifelse Bees-killed-by-insecticides > 0
    [if any? plant1s [ask n-of (1 + ((Bees-killed-by-insecticides * count plant1s / 1000))) plant1s [set shape "sunflower-11"]]]
    [if any? plant1s [ask plant1s [ifelse visit-1 < 2 [set color 26 set shape "sunflower-1"][set color 35 set shape "sunflower"]]]]

  ask bees
  [if count bees >= 100 - Bees-killed-by-insecticides
    [if random 2 = 0 [die]]]
end 

to building-houses-1

ifelse not any? buildings
  [ask patches with [pxcor = 2 and pycor = 3] [building-a-house ]]
  [ifelse any? building-land with [pycor = 3]
    [ask patches with [pxcor = max [pxcor] of patches with [bldg = 1] + 2 and pycor = 3] [building-a-house]]
    [ifelse not any? buildings with [pycor = 6]
       [ask patches with [pxcor = 2 and pycor = 6] [building-a-house ]]
       [ifelse any? building-land with [pycor = 6]
          [ask patches with [pxcor = max [pxcor] of patches with [bldg = 1 and pycor = 6] + 2 and pycor = 6] [building-a-house]]
          [ifelse not any? buildings with [pycor = 9]
             [ask patches with [pxcor = 2 and pycor = 9] [building-a-house ]]
             [ifelse any? building-land with [pycor = 9]
                [ask patches with [pxcor = max [pxcor] of patches with [bldg = 1 and pycor = 9] + 2 and pycor = 9] [building-a-house]]
                 [ifelse not any? buildings with [pycor = 12]
                    [ask patches with [pxcor = 2 and pycor = 12] [building-a-house ]]
                    [ifelse any? building-land with [pycor = 12]
                      [ask patches with [pxcor = max [pxcor] of patches with [bldg = 1 and pycor = 12] + 2 and pycor = 12] [building-a-house]]
                      [ifelse not any? buildings with [pycor = 15]
                         [ask patches with [pxcor = 2 and pycor = 15] [building-a-house ]]
                         [if any? building-land with [pycor = 15]
                             [ask patches with [pxcor = max [pxcor] of patches with [bldg = 1 and pycor = 15] + 2 and pycor = 15] [building-a-house]]


  ]]]]]]]]]
end 

to do-plot  ;; this creates creates the bar graph
    set-current-plot "Oil and Honey Yields"
    clear-plot
    plot-pen-down
    set-current-plot-pen "Sunflower Oil"
    plotxy 0 oil
    set-current-plot-pen "Honey"
    plotxy 1 honey
end 

to setup-legends

  create-legends 10

  ask legend 0
  [set shape "sunflower-1"
    set size 1
    set color 26
    setxy 1.5 0.75]

  ask legend 1
  [set shape "bee"
    set color yellow
    set size 0.75
    setxy 3.75 0.75]


  ask legend 2
  [set shape "house-1"
    set color gray
    set size 1.25
    setxy 10.55 0.75]

  ask legend 3
  [set shape "sunflower-11"
    set color 26
    set size 1
    setxy 8 0.75]

  ask legend 4
  [set shape "blank"
    set color 136
    set size 1.5
    set label "Sunflower"
    set label-color 0
    set heading 90
    setxy 1.5 0.5]

  ask legend 5
  [set shape "blank"
    set color 136
    set size 1.5
    set label "Sprayed flower"
    set label-color 0
    set heading 75
    setxy 8.4 0.5]

  ask legend 6
  [set shape "blank"
    set color 136
    set size 1.5
    set label "Bee"
    set label-color 0
    set heading 75
    setxy 3.35 0.5]

  ask legend 7
  [set shape "blank"
    set color 136
    set size 1
    set label "Building lot"
    set label-color 0
    set heading 75
    setxy 11 0.25]

  ask legend 8
  [set shape "sunflower"
    set color 35
    set size 1
    set label ""
    set label-color 0
    set heading 75
    setxy 5.75 0.75]

  ask legend 9
  [set shape "blank"
    set color 136
    set size 1
    set label "Seeds"
    set label-color 0
    set heading 75
    setxy 5.75 0.25]
end 

There are 2 versions of this model.

Uploaded by When Description Download
lin xiang over 1 year ago Update the plotting Download this version
lin xiang about 2 years ago Initial upload Download this version

Attached files

File Type Description Last updated
Community interaction-Mutually beneficial.png preview Preview for 'Community interaction-Mutually beneficial' about 2 years ago, by lin xiang Download

This model does not have any ancestors.

This model does not have any descendants.