WLM 3.t Slange simulering SRP
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 [vov a-vov ] ; volume of venom breed [snake a-snake ] breed [food a-food ] breed [predator a-predator] breed [tree a-tree ] snake-own [ energy snake-volume-venom venom-range rattle ] predator-own [ energy size-matters ] to setup clear-all ask patches [ set pcolor brown ] set-default-shape snake "turtle" create-snake number-snakes-at-start [ set size 1 set color blue setxy random-xcor random-ycor set snake-volume-venom 1 + random 6 set venom-range 3 ] set-default-shape predator "circle" create-predator number-predators-at-start [ set size size-of-predators set color red setxy random-xcor random-ycor set size-matters 0 ] set-default-shape food "circle" create-food number-food-at-start [ set color green set size 0.75 setxy random-xcor random-ycor ] if trees? [ set-default-shape tree "tree" create-tree 35 [ set size 2 setxy random-xcor random-ycor set color 53 ] ] if range? [ ] ask snake [set energy 100 ] ask predator [set energy 40 ] ask snake [ produce-vov ] reset-ticks end to go if (( not any? snake) or ( not any? predator )) [ print "stopping ! " stop ] ask snake [ move set energy energy - 1 catch-food reproduce-snake death ] ask predator [ move set energy energy - 1 catch-snake death reproduce-predator ] make-new-food tick end to make-new-food if 30 < food-respawn [ create-food 3 [ set color green setxy random-xcor random-ycor ] ] end to move rt random 50 lt random 50 fd 1 end to death if energy < 0 [ die ] end to catch-food let prey one-of food in-radius venom-range if prey != nobody [ ask prey [ die ] set energy energy + food-gain-for-snakes set snake-volume-venom snake-volume-venom + venom-gain ] end to catch-snake let prey one-of snake in-radius 1.5 if prey != nobody [ ifelse [ snake-volume-venom ] of prey < size-matters [ ask self [ print ( word "Attacking predator " self "was intoxicated and will die now " ) ;user-message "Predator died in a fight with a snake" die ]] [print (word "Attacking predator wins against snake: " ) show prey ;user-message "Predator successfully hunted and killed a snake" ask prey [ die ] ] set energy energy + food-gain-for-predators ] end to reproduce-snake if random-float 100 < snake-reproduce [ set energy energy * 1 / 2 hatch 1 [ rt random-float 360 fd 1 ]] end to reproduce-predator if random-float 150 < predator-reproduce [ set energy energy * 2 / 3 hatch 1 [ rt random-float 360 fd 1 ] ] end to produce-vov let prey one-of snake let rad snake-volume-venom hatch-vov 1 [ set color yellow set shape "circle" set size ( [ snake-volume-venom ] of prey + [ rad ] of prey) / 3 create-link-from myself [ tie ] ] end to predator-size-matters ifelse size-of-predators > 1.5 [ set size-matters size-matters + 7 ] [ set size-matters size-matters + 5 ] end to range-venom if range? [ set venom-range venom-range + 2 ] end
There is only one version of this model, created over 4 years ago by William Lohmann Meyhoff.
Attached files
No files
This model does not have any ancestors.
This model does not have any descendants.