bees0.3
Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)
WHAT IS IT?
(a general understanding of what the model is trying to show or explain)
HOW IT WORKS
(what rules the agents use to create the overall behavior of the model)
HOW TO USE IT
(how to use the model, including a description of each of the items in the Interface tab)
THINGS TO NOTICE
(suggested things for the user to notice while running the model)
THINGS TO TRY
(suggested things for the user to try to do (move sliders, switches, etc.) with the model)
EXTENDING THE MODEL
(suggested things to add or change in the Code tab to make the model more complicated, detailed, accurate, etc.)
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
(a reference to the model's URL on the web if it has one, as well as any other necessary credits, citations, and links)
Comments and Questions
breed [ bees bee ] breed [ flowers flower ] breed [ hives hive ] breed [ apples apple ] flowers-own [ age fertilisation-count fl-nectar? ] bees-own [ nectar direction target wiggle-time dance-time ] hives-own [ nectar-count ] to setup ca create-bees initial-bees [ set color yellow set direction "search" set target nobody set wiggle-time 0 set size 2 set shape "bug" ;;move-to one-of patches ] ask patches with [ pycor <= 1 and pycor >= -1 and pxcor <= 1 and pxcor >= -1 ] [ set pcolor blue ] let a ( count patches with [ pcolor != blue ] ) / 10 ask n-of a patches with [ pcolor != blue ] [ sprout-flowers 1 [ set color one-of [ red green blue ] set shape "flower" set size 2 set fl-nectar? true ] ] ask patch 0 0 [ set pcolor white sprout-hives 1 [ set shape "square 2" set color [ 20 20 20 100 ] set size 3 ] ] reset-ticks end to go ask bees [ bees-movement ] ask flowers with [ fertilisation-count > 20 and fertilisation-count < 30 ] [ hatch-apples 1 [ create-link-with min-one-of flowers [ distance myself ] set heading random 360 fd random-float 1 set size 0.1 set color 12 + random 5 set shape "circle" ] ] ask flowers with [ fertilisation-count >= 40 ] [ set fl-nectar? false ] ask apples with [ size <= 0.5 ] [ set size size + 0.1 ] tick end to-report count-apples report count apples with [ size >= .5 ] end to bees-movement if direction = "search" and target = nobody [ set target one-of flowers ] if direction = "search" and target != nobody [ ;; output-print "hurrah!" face target fd 1 rt 20 - random 40 ] if one-of turtles-here = target and direction = "search" [ set direction "wiggle time" set wiggle-time 5 ] if direction = "wiggle time" [ set heading heading - random 30 set wiggle-time wiggle-time - 1 let a min-one-of flowers [ distance myself ] if [ fl-nectar? = true ] of a [ ask a [ set nectar nectar + 1 ] ask min-one-of flowers [ distance myself ] [ set fertilisation-count fertilisation-count + 1 ] ] ] if direction = "wiggle time" and wiggle-time <= 0 [ set direction "search" set target nobody ] if nectar >= 15 [ set direction "hive" set wiggle-time 0 set target one-of hives ] if direction = "hive" [ face target fd 1 rt 10 - random 20 if distance target <= 2 [ move-to target ] ] if one-of turtles-here = target and direction = "hive" [ ask one-of hives [ set nectar-count nectar-count + 5 ] set nectar 0 set direction "hive dance" set dance-time 5 ] if direction = "hive dance" [ set dance-time dance-time - 1 rt 10 if dance-time <= 0 [ set direction "search" set target nobody ] ] end
There are 5 versions of this model.
Attached files
No files