Turtles trapped
Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)
ODD (Overview, Design, Detail Concepts): Overview:
Purpose: Purpose of this model is to perform simulations for turtles and trapped them in box and observe the behaviour.
Entities, state variables and scales
Entitiy | State variable | Symbol | Value
Agents | Breeds |
| Setting x position | pxcor | -150 + who * 3
| Setting y position | pycor | random
| Size | size | 9
| Shape | shape | circle
| Color | color | green
| Patches |
| Name patch |
| Setting x position | pxcor | greater than equal to 0
| Setting y position | pycor | greater than equal to 0
| Color | color | red
| Label patch |
| Setting x position | pxcor | 185
| Setting y position | pycor | 87
| Label | plabel | ROHA ALI
| Label color | plabel-color | white
Globals | Output |
| Name patch | name-patch | default
| Label patch | label-patch | default
| Trapped | trapped? | true, false
| Turtle ahead patch | turtle-patch | patches in cone 20 5
Grid cells| Maximum Horizontal position in grid | max-pxcor | 200
| Maximum Vertical position in grd | max-pycor | 200
Process overview and scheduling:
Simulations start with setup procedure screen is cleared and red box is created with label. Breeds are created with specified number in random position. After setup procedure, simulation state enter the main procedure. Breeds start walking randomly and getting trapped in the red box.
Design concepts Interaction: Breeds and patches interact with each other such as breeds walk and get trapped in one of box patches. Stochasticity: Breeds walk randomly on patches.
Initialization: The initialization process begins by setting up screen and setting font style.
Sub models Setup Name: This model is called by setup procedure. In this model, patches right above portion is set to red than we select one of its patches and assign label to it. Setup Breed: This model is also called by setup procedure. 26 Breeds are created and their position, color, size and shape is assigned. Wander: This model is called by go procedure. Breeds wander right left and then forward 1. Wander in letters: This model is also called by go procedure. Each breed have assigned vision cone with specified radius and diameter.If breeds see red patch then they head toowards letter. After that tey waander slowly and try too get out of box.
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 [ RohaAlis RohaAli ] globals[ name-patch label-patch trapped? turtle-ahead ] to setup clear-all ask patches [ set pcolor white] setupname setup-breeds reset-ticks end to setupname set name-patch patches with [ pxcor >= 0 and pycor >= 0] ask name-patch [ set pcolor red ] ask patch 185 87 [ set label-patch self set plabel-color white set plabel "ROHA ALI" ] end to setup-breeds create-RohaAlis 26 ask RohaAlis [ setxy -150 + who * 3 random-ycor set shape "circle" set size 9 set color green ] end to go ask RohaAlis [ wander wander-in-letters ] if get-untrapped = 0 [ stop ] tick end to wander rt random 20 lt random 20 fd 0.6 if (any? other RohaAlis-here) [wander] end to wander-in-letters set turtle-ahead other patches in-cone 20 5 if ( pcolor = red ) [ set heading towards label-patch rt random 20 lt random 20 fd 0.62 set trapped? true if ( [pxcor] of patch-ahead 0.1 > 0 ) and ( trapped? = true ) ;;if so, reflect heading around x axis [ set heading (- heading) ] ; check: hitting top or bottom wall? if ( [pycor] of patch-ahead 0.1 > 0 ) and ( trapped? = true ) ; if so, reflect heading around y axis [ set heading (180 - heading) ] if pcolor = white [ set trapped? false ] ] end to-report get-trapped report count RohaAlis with [ pcolor = red ] end to-report get-untrapped report count RohaAlis with [ pcolor = white ] end
There is only one version of this model, created about 7 years ago by Roha Ali.
Attached files
No files
This model does not have any ancestors.
This model does not have any descendants.