Download presentation
Presentation is loading. Please wait.
Published byThomas Parrish Modified over 9 years ago
1
New Mexico Computer Science For All Patches and Agent/Environment Interactions Maureen Psaila-Dombrowski
2
Why are Patches Important Agent based modeling ▫Agents (turtles) interact with other agents (turtles) ▫Agents (turtles) interact with the environment (patches) Turtle – Patch interaction is an important part of creating models in NetLogo
3
Patches in NetLogo Patches are a type of agent The NetLogo world is a two dimensional grid of "patches” - like a tiled floor Unique identifier ▫Turtles have an number: ask turtle 1 ▫Patches have Coordinates: pxcor pycor Default Origin: 0 0 All other patches are referenced to the origin Ask patch 1 1
4
Patches NetLogo World Patches Coordinates: pxcor pycor max-pxcor = 3 min-pxcor = -3 Max-pycor = 3 Min-pycor = -3 Number of Patches (Max - min + 1) Total across = 7 Total up/down = 7 Total patches = 7 x 7 Total patches = 49
5
Can change the number of patches in the 2D NetLogo world ▫Interface tab ▫Settings button (upper right corner) Patches – changing number of patches
9
Command ▫Turtles: create-turtles # ▫Patches: resize-world # # # # resize-world min-pxcor max-pxcor min-pycor max-pycor resize-world -16 16 -16 16 Patches – changing number of patches
10
For Turtles – set size # Can change the size of patches in the 2D NetLogo world ▫Interface tab ▫Settings button (upper right corner) Patches – changing size of patches
13
Command ▫Turtles: set size # ▫Patches: set-patch-size # set-patch-size 10 Patches – changing size of patches
14
Other Patch Related Commands clear-patches set pcolor # (or name or RGB) ask patch # # [commands] ask patches [commands] random-pxcor / random-pycor distancexy # # patch-ahead
15
Turtle/Patch Interactions Turtles can interact with patches in many ways Variety of Triggers Patch color Patch location Patch occupant (other turtles, breeds)
16
Turtle/Patch Interactions Response Change Turtle related property Shape/Color/Size Direction Die/propagate Variable Change Patch characteristics Color Variable Other Response
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.