Beehive Migration

Beehive Migration preview image

2 collaborators

Default-person Vidushi Patel (Author)
Bryan Boruff (Advisor)

Tags

beekeeping 

Tagged by Vidushi Patel over 3 years ago

Visible to everyone | Changeable by the author
Model was written in NetLogo 6.2.0 • Viewed 365 times • Downloaded 44 times • Run 0 times
Download the 'Beehive Migration' 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?

Beekeeping involves complex interactions among various social and ecological entities.Any change in social or ecological entities affects sustainability of beekeeping system. Accessing forage sites through migrating beehives around the landscape is one of the core interactions for beekeeping system.This model represents spatial patterns of beehive migration based on beekeepers' decision preferences for forage availability,quality and travel distance required to access the forage sites.

The influence of a change in current forage-availability (baseline) relative to future forage-availability on the spatial-patterns of beehive migration has been explored in this model.Any stressors that affect a change in forage availability can be explored using this model.

In addition to the change in forage-availability, a scenario with different proportion of commercial and semi-commercial beekeepers can also be explored for its impacts on beekeeping system.

The model contains two types of agents (i) beekeepers - full-time? = false if number of loads (numloads) owned by a beekeeper agent is 1 - 4 and (ii) load (of beehives) - loadid is an identifier for owner beekeeper. Forage-availability environment contains two main variables that influence beekeepers' forage site selection. This includes (i) high-rich? = true if value of patche's richness variable = defined_richness and (ii) premium? = true if beekeeper's favorite species is available on the patch. The model runs on monthly timestep.

HOW IT WORKS

A beekeeper agents decide to migrate once forage resource on their load's patch becomes unavailable. A beekeeper agent that identifies a new target patch (potentialtargets) then evaluates migration to that site using the if-then rules, where patches with premium? = true are the first priority followed by patches with high-rich? = true as a second priority. In a case where sites with none of these priorities are available beekeepers choose any patches with forage resource available (availableforage = 1). Beekeeper agents then identify one patch as a reference patch (reftarget) from the set of mytargets. In addition to the forage- Load agents use their owner's reftarget to identify a new forage site (myforagecells = mytargets) following their owner’s decision model.

HOW TO USE IT

Select forageavilabilityscenario and/ or beekeeper proportion, adjust 'proximity', 'richness' and 'spread' sliders, click setup for world setup. Click go to run the model.

THINGS TO NOTICE

Notice the change in patterns of monthly forage availability, compare the distance travelled by commercial and semi-commercial beekeepers. Also notice the values for 'No target found' plot.

THINGS TO TRY

Use different combination of 'beekeeper population' and 'forage availability' scenario.

Test different combination of 'proximity'and 'spread' to understand migration decisions.

Change the value of richness slider and run the model to understand how resource quality may influence hive migration decisions.

Try random distribution of premium species and observe the patterns.

EXTENDING THE MODEL

To improve the model further, sptial data can be included to build environment.

Additional scenarios can be included when extending this model. For example,

'Land management' scenario with various land management decisions can also provide important decision support for beekeeping sustainability.

Extension can also include, additional decision criteria for forage site selection can make the model more complicated. For example, if Honey production potential of each patch is included, a decisions based on utility maximization can be implemented to test the heterogenous decision-making by agents to increase complexity.

NETLOGO FEATURES

(interesting or unusual features of NetLogo that the model uses, particularly in the Code tab; or where workarounds were needed for missing features)

RELATED MODELS

(models in the NetLogo Models Library and elsewhere which are of related interest)

CREDITS AND REFERENCES

This model is developed as a proof of concept for beehive migration process. A precursor of a spatially explicit hybrid ABM- B-Agent, which focuses on climate change scenario by incorporating forage-availability relative to baseline and future climate.

Comments and Questions

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

Click to Run Model

globals [ num_months harvest_rate harvest_rate_premium harvest_rate_high_rich harvest_rate_low_rich]
breed [ beekeepers beekeeper]
breed [ loads load ]

patches-own [ harvest_count
  high_rich?
  premium?
  available_forage
  sp_rich
  availability
  richness
  favorite_sp
  favorite_sp?
  my_agentid
]
beekeepers-own [
  potential_targets
  my_targets
  split_number
  reftarget
  my_home
  num_loads
  my_loads
  distance_this_tick
  total_distance_travelled
  num_moved
  used_targets
  No_target_found
  full_time?
  want_move?
]

loads-own [
  load_id
  my_forage_cell
  visited?
  move_count
  used_forage_cells]


;;;Setup Commands

to setup
  ca
  random-seed 0
  set num_months 12
  grow_forest
  make_beekeepers
  make_loads
  reset-ticks
end 

to grow_forest
  ask patches [
    if random 2 = 1 [ set pcolor 57 ]
  ]

  setup_monthly_forage_availability
end 

to setup_monthly_forage_availability

  ifelse forage_availability_setup = "baseline" [

    ask patches [
      set harvest_count 0
      set my_agentid [ ]
      set availability [ ]
      set sp_rich [ ]
      set favorite_sp [ ]

      repeat num_months [
        set availability lput random 2 availability
        set sp_rich lput random 9 sp_rich
        ;set favorite_sp lput random 2 favorite_sp - use this line instead of the following line for random distribution of favorite species across the region
        ifelse pxcor < -15  [ set favorite_sp lput random (2 + 1) favorite_sp ][ set favorite_sp lput random 1 favorite_sp ]
      ]
    ]
  ]
  [  ask patches [
    set harvest_count 0
    set my_agentid [ ]
    set availability [ ]
    set sp_rich [ ]
    set favorite_sp [ ]

    repeat num_months [
      set availability lput random 2 availability
      set sp_rich lput random 9 sp_rich
      ;set favorite_sp lput random 2 favorite_sp - use this line instead of the following line for random distribution of favorite species across the region
      ifelse pxcor < -17  [ set favorite_sp lput random (2 + 1) favorite_sp ][ set favorite_sp lput random 1 favorite_sp ]
    ]
    ]
  ]
end 

to make_beekeepers
  let beekeeper_home up-to-n-of (beekeeper_population) patches with [ pcolor = black]
  ask beekeeper_home [ sprout-beekeepers 1 ]
  ask beekeepers [
    set shape "person"
    set size 2
    set my_home patch-here

  ]
  ifelse beekeeper_proportion = "baseline" [ ask n-of ((beekeeper_population) * 0.1) beekeepers [ set full_time? true ] ]
  [ifelse beekeeper_proportion = "equal" [ ask n-of ((beekeeper_population) * 0.5) beekeepers [ set full_time? true ] ]
    [ ask n-of ((beekeeper_population) * 0.9) beekeepers [ set full_time? true ] ] ]


  ; ask n-of ((beekeeper_population) * 0.5) beekeepers [ set full_time? true ]
  ask beekeepers [ ifelse full_time? = true [ set num_loads random 14 + 5  set color blue ] [ set num_loads random 4 + 1 set full_time? false set color red ] ]
  ;    ;set num_loads random 15 + 1
  ;    if num_loads > 5 [ set full_time? false set color red]
  ;    ;set label num_loads
  ;
  ;   ; pen-down
  ; ]
end 

to make_loads
  ask beekeepers [

    hatch-loads num_loads [
      set shape "box"
      set size 1
      pen-up

      set load_id [ who ] of myself
      set my_forage_cell [my_home] of myself
      set label ""
      set move_count 0
      set used_forage_cells [ ]

    ]

    set my_loads loads with [ load_id = [who] of myself ]
  ]
end 

;;;On Tick

to clear_labels ; global command
  ask patches [ set plabel ""]
end 

to go
   clear_labels
  ;clear-drawing
  if (ticks < 1) [ reset-timer]

  if ticks = num_months
  [
    ask beekeepers [
      move-to my_home
      ask my_loads [ move-to [my_home] of myself ]
    ]


    ask patches with [ harvest_count > 0 ] [
    ;set plabel my_agentid
    set pcolor yellow
    ]
    show (word "execution finished in "timer" seconds" )
    stop
  ]

  ask beekeepers [
    set split_number 0
    set num_moved 0
    if available_forage = 0 [ set want_move? true
      pick_new_target ]
  ]

  update_availability
  update_targets

  relocate
  set harvest_rate ((count patches with [ harvest_count > 0]) / count patches ) * 100
  set harvest_rate_premium ((count patches with [ harvest_count > 0 AND premium? = true ]) / (count patches with [premium? = true]))* 100
  set harvest_rate_high_rich ((count patches with [ harvest_count > 0 AND high_rich? = true ]) / (count patches with [high_rich? = true])) * 100
  set harvest_rate_low_rich (count patches with [ harvest_count > 0 AND high_rich? = false ]) / (count patches with [high_rich? = false])* 100
  wait .5


  tick
end 

to update_availability ; global command
  ask patches [
    set available_forage item ticks availability
    set richness item ticks sp_rich
    set favorite_sp? item ticks favorite_sp

    ifelse available_forage = 0 [
      set pcolor black
    ] [
      set pcolor 57
    ]

    ifelse favorite_sp? = 0 [
      set premium? false
    ] [
      set premium? true
      set pcolor 125
    ]

    ifelse richness > defined_richness [
      set high_rich? true
    ] [
      set high_rich? false
    ]
  ]
end 

to update_targets
  ask beekeepers  [ if available_forage = 0 [ pick_new_target ]]
end 

to pick_new_target ; Beekeeper chooses nearby patch, prioritizing premium and rich patches
  ifelse full_time? = false [ set  potential_targets patches with [(available self) and (distance myself < proximity)]] [ set potential_targets patches with [(available self)] ]
  ;;;;;;;;;;;;;;;;;;;;;;;;;;  decision criteria ;;;;;;;;;;;;;;

  ifelse any? potential_targets[
    ( ifelse

      any? potential_targets with [ premium? = true] [
        set my_targets potential_targets with [ premium? = true]
      ]

      any? potential_targets with [ high_rich? = true] [
        set my_targets potential_targets with [ high_rich? = true]
      ]

      [ set my_targets potential_targets ]
  )] [ move-to my_home
    set No_target_found No_target_found + 1
    set color red
    ask my_loads [ move-to [my_home] of myself] ]

  set reftarget one-of my_targets
  set split_number split_number + 1
end 

to relocate
  ask loads [ migrate ]
  ; wait .5
  ask beekeepers [ travel ]
end 

to migrate ; load command
  let bkpr beekeeper load_id
  let target [reftarget] of bkpr

  let open_spots patches with [ (patch_distance self target < spread) AND (available self) ]

  ( ifelse
    any? open_spots with [ premium? = true ] [
      set open_spots open_spots with [ premium? = true ]
    ]

    any? open_spots with [ high_rich? = true ] [
      set open_spots open_spots with [ high_rich? = true ]
    ]

  )


  if [available_forage] of patch-here = 0  [

    ifelse (any? open_spots) [
      set my_forage_cell one-of open_spots
    ] [
      ifelse [split_number] of bkpr < 2
      [
        ask bkpr [ pick_new_target ]
        migrate
      ] [
        set my_forage_cell [my_home] of bkpr
      ]
    ]
    move-to my_forage_cell
    set move_count move_count + 1
    set used_forage_cells lput patch-here used_forage_cells
  ]



  ask my_forage_cell [
    set harvest_count harvest_count + 1
    set my_agentid lput [who] of bkpr my_agentid
    ;set pcolor red
  ]
  ; wait .1
end 

to travel ;Travels to loads one at a time, uses the nearest-neighbor algorithm
  set distance_this_tick 0
  ask my_loads [ set visited? FALSE ]
  let unvisited_loads my_loads with [ visited? = FALSE ]

  while [any? unvisited_loads] [
    let closest_load min-one-of unvisited_loads [ distance myself ]
    set distance_this_tick distance_this_tick + patch_distance patch-here closest_load
    move-to closest_load
    set num_moved num_moved + 1

    ask closest_load [ set visited? TRUE ]
    set unvisited_loads unvisited_loads with [ visited? = FALSE ]
  ]

  set distance_this_tick distance_this_tick + distance my_home
  set total_distance_travelled total_distance_travelled + distance_this_tick
end 

;;;reporters

to-report available [pch]
  ifelse ([pcolor] of pch = 57 or [pcolor] of pch = 125) AND (not any? loads-here)
  [report true]
  [report false]
end 

to-report patch_distance [ pch1 pch2 ]
  let x1 [pxcor] of pch1
  let y1 [pycor] of pch1

  let x2 [pxcor] of pch2
  let y2 [pycor] of pch2

  let xdiff x1 - x2
  let ydiff y1 - y2

  report sqrt (xdiff ^ 2 + ydiff ^ 2)
end 

;;;;;;;;;;;;;;;;;;; output reporters ;;;;;;;;;;;;;;;;;;;;;;;;;

to-report initial_forage
  report count patches with [ harvest_count = 0] * 100  / count patches
end 

to-report premium_cells
  report count patches with [premium? = true]
end 

to-report rich_cells
  report count patches with [premium? = true]
end 

to-report percent_harvested
  report (count patches with [ harvest_count > 0 ] / count patches ) * 100
end 

to-report percent_harvested_premium
  report (count patches with [ harvest_count > 0 AND premium? = true] / count patches with [ premium? = true]  ) * 100
end 

to-report percent_harvested_rich
  report (count patches with [ harvest_count > 0 AND high_rich? = true] / count patches with [ high_rich? = true]  ) * 100
end 

to-report beekeepers_with_no_target
  report count beekeepers with [ No_target_found > 0 ]
end 

to-report distance_commercial
  report mean [total_distance_travelled] of beekeepers with [full_time? = true]
end 

to-report distance_semi_commercial
  report mean [total_distance_travelled] of beekeepers with [full_time? = false]
end 

There are 5 versions of this model.

Uploaded by When Description Download
Vidushi Patel over 3 years ago Visualization updated Download this version
Vidushi Patel over 3 years ago Improved visualization Download this version
Vidushi Patel over 3 years ago Updated for better visualization of harvested patches Download this version
Vidushi Patel over 3 years ago Cleaned code Download this version
Vidushi Patel over 3 years ago Initial upload Download this version

Attached files

File Type Description Last updated
Beehive Migration.png preview Preview for 'Beehive Migration' over 3 years ago, by Vidushi Patel Download

This model does not have any ancestors.

This model does not have any descendants.