banner-nll

Patch Variables

NetLogo has several pre-defined patch variables:

pcolor

This is a predefined patch variable. It holds the color of the patch. You can  set this variable to make the patch change color.

All patch variables can be directly accessed by any turtle standing on the patch.

See also color.

plabel

This is a predefined patch variable. It may hold a value of any type. The  patch appears in the graphics window with the given value "attached" to it as  text. You can set this variable to add, change, or remove a patch's label.

All patch variables can be directly accessed by any turtle standing on the patch.

See also no-label, plabel-color, label, label-color.

plabel-color

This is a predefined patch variable. It holds a number greater than or equal to 0 and less than 140. This number determines what color the patch's label appears in (if it has a label). You can set this variable to change the color of a patch's label.

All patch variables can be directly accessed by any turtle standing on the patch.

See also no-label, plabel, label, label-color.

pxcor

This is a predefined patch variable. It holds the x coordinate of the patch. This is always an integer. You cannot set this variable, because patches don't move.

This variable is greater than or equal to 0 - screen-edge-x and less than or equal to screen-edge-x.

All patch variables can be directly accessed by any turtle standing on the patch.

See also pycor, xcor, ycor.

pycor

This is a predefined patch variable. It holds the y coordinate of the patch. This is always an integer. You cannot set this variable, because patches don't move.

This variable is greater than or equal to 0 - screen-edge-y and less than or equal to screen-edge-y.

All patch variables can be directly accessed by any turtle standing on the patch.

See also pxcor, xcor, ycor.


With Support from:

The NetLogo Learning Lab is part of modelingcomplexity.org, the home of the Mesa State College Center for Agent-Based Modeling.

This website is copyright by Mesa State College, 2004. All rights are reserved.

Some materials are adapted from the NetLogo User manual, and are copyright Wilensky, U. (1999). NetLogo.  Center for Connected Learning and Computer-Based Modeling. Northwestern University, Evanston, IL.