The Dictionary of NetLogo Primitives

 
 
Filters
 
Alphabetical
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
 
 

A back to top


all?

utilities

Checks if a reporter is true for all the agents in an agentset.

Read more
 

and

utilities

Checks if both provided conditions are true.

Read more
 

any?

utilities

Checks if there is at least one agent in an agentset.

Read more
 

ask

observer

Asks agents to do things.

Read more
 

B back to top


breed

observer

Defines a custom breed of turtles.

Read more
 

C back to top


ca

observer

Clears all the drawings, turtles, plots, etc., leaving a blank slate.

Read more
 

ceiling

utilities

Rounds a number up to the nearest integer.

Read more
 

clear-all

observer

Clears all the drawings, turtles, plots, etc., leaving a blank slate.

Read more
 

clear-patches

observer

Clears the patches by resetting all patch variables to their default initial values and making them black.

Read more
 

clear-turtles

observer

Removes all the turtles as well as resets the numbering of turtles.

Read more
 

color

turtles links

Built-in turtle characteristic that reports the color of a turtle and allows us to change it.

Read more
 

count

utilities

Counts the number of agents in an agentset.

Read more
 

create-links-with

turtles

Creates links with every agent in an agentset.

Read more
 

create-turtles

observer

Creates turtles with random colors and headings at the center of the world.

Read more
 

crt

observer

Creates turtles with random colors and headings at the center of the world.

Read more
 

D back to top


die

turtles links

Removes a turtle or link from the world.

Read more
 

diffuse

patches

Spreads a patch characteristic to its neighbors.

Read more
 

distance

turtles patches

Reports the distance from one turtle/patch agent to another.

Read more
 

E back to top


end

observer

Concludes a procedure.

Read more
 

F back to top


face

turtles

Changes a turtle's heading towards another turtle or patch.

Read more
 

facexy

turtles

Changes a turtle's heading towards a specific point (x, y) in the world.

Read more
 

fd

turtles

Makes a turtle move in any number of units on a straight path.

Read more
 

floor

utilities

Rounds a number down to the nearest integer.

Read more
 

forward

turtles

Makes a turtle move in any number of units on a straight path.

Read more
 

G back to top


globals

observer

Defines variables that can be accessed throughout the whole model and has the same value for all the agents.

Read more
 

H back to top


hatch

turtles

Makes a turtle make any number of new turtles that are identical to itself.

Read more
 

I back to top


if

utilities

Carries out a provided set of rules (code) if a given condition is true. Does nothing if a given condition is false.

Read more
 

ifelse

utilities

Carries out one set of rules if a given condition is true, and another set of rules if a given condition is false.

Read more
 

ifelse-value

utilities

Picks a value based on a provided list of condition-value pairs.

Read more
 

in-cone

turtles

Reports members of an agentset within a "cone-of-vision" of an agent.

Read more
 

in-radius

turtles patches

Reports members of an agentset within a certain radius of an agent.

Read more
 

L back to top


layout-circle

observer

Places turtles in a circle circle around the center of the world.

Read more
 

left

turtles

Turns a turtle certain amount of degrees to the left.

Read more
 

let

utilities

Creates a local variable that only exists within a procedure or a statement surrounded with brackets (`[ ]`).

Read more
 

link-neighbors

turtles

Reports all agents connected to a turtle with links.

Read more
 

links

links

Reports an agentset that contains all the links in a model.

Read more
 

M back to top


max

utilities

Reports the highest value in a provided list.

Read more
 

max-n-of

utilities

Reports a list of top values in a provided list.

Read more
 

max-pxcor

utilities

Reports the largest x-coordinate of the patches in a model.

Read more
 

max-pycor

utilities

Reports the largest y-coordinate of the patches in a model.

Read more
 

mean

utilities

Reports the average of a provided list of numerical values.

Read more
 

member?

utilities

Reports true if a value is within a list or if an agent is in an agentset.

Read more
 

min-pxcor

utilities

Reports the smallest x-coordinate of the patches in a model.

Read more
 

min-pycor

utilities

Reports the smallest y-coordinate of the patches in a model.

Read more
 

mod

utilities

Performs the modulo operation; reports the remainder from the division of the first number by the second number.

Read more
 

move-to

turtles

Moves a turtle to set its x and y coordinates to be the same as another turtle or patch.

Read more
 

myself

turtles patches links

Reports the original turtle that asked another turtle to follow some rules.

Read more
 

N back to top


n-of

utilities

Reports "n" randomly picked agents from an agentset or items from a list.

Read more
 

neighbors

turtles patches

Reports an agentset containing the eight neighboring patches.

Read more
 

neighbors4

turtles patches

Reports an agentset containing the four neighboring patches in cardinal directions (north, west, south, east).

Read more
 

nobody

utilities

A special value that helps checking if an agent exists or not.

Read more
 

O back to top


of

utilities

Reports the value of an agent-owned variable.

Read more
 

one-of

utilities

Reports one randomly picked member from a provided agentset or list.

Read more
 

or

utilities

Checks if either of two provided conditions is true.

Read more
 

other

turtles

Reports an agentset which is the same as the input agentset but omits the agent that used this primitive.

Read more
 

P back to top


patch

observer

Reports a specific patch at the provided (x,y) conditions.

Read more
 

patch-ahead

turtles

Reports the single patch that is the given distance “ahead” of this turtle

Read more
 

patches

observer

Reports an agentset that contains all the patches in a model.

Read more
 

patches-own

observer

Defines custom characteristics (variables) for patches. Each custom characteristic can have a different value for each patch.

Read more
 

pcolor

turtles patches

Reports a patch's color and changes a patch's color when used with the set primitive.

Read more
 

pen-down

turtles

Starts tracing the movement of the turtle on patches.

Read more
 

pen-up

turtles

Stops tracing a turtle's movement.

Read more
 

R back to top


random

utilities

Reports a random whole number between 0 and a specified number.

Read more
 

random-float

utilities

Reports a random number with decimal points between 0 and a specified number.

Read more
 

random-normal

utilities

Reports a random number with decimal points that is picked from over a normal distribution with a specified mean and standard deviation.

Read more
 

repeat

utilities

Performs a provided set of rules (commands) repeatedly for a specified number of times.

Read more
 

reset-ticks

observer

Sets the tick counter to 0.

Read more
 

right

turtles

Changes a turtle's heading a certain amount of degrees to the right.

Read more
 

round

utilities

Reports the integer that is nearest to a specified value.

Read more
 

S back to top


scale-color

utilities

Reports a shade of a base hue (color) based on where a speficied value falls is within a specified range (min-max).

Read more
 

semicolon

utilities

Starts a comments to take notes on a line of code. anything that follows a semicolon (;) will not be considered code.

Read more
 

set

utilities

Changes the value of a variable (global, local, or agent-owned).

Read more
 

setxy

turtles

Moves a turtle to the exact location defined by the provided x and y coordinates.

Read more
 

shape

turtles links

Reports a turtles or link's shape and changes a turtle's or link's shape when used with the set primitive.

Read more
 

sort-by

utilities

Reports a sorted version of a provided list based on a user-defined comparison.

Read more
 

sort-on

utilities

Reports a sorted version of a provided agentset based on a user-defined comparison.

Read more
 

sprout

patches

Creates new turtles at the center of a patch.

Read more
 

T back to top


tick

observer

Advances the tick counter by 1.

Read more
 

tie

links

Turns a link between two turtles into a rigid connection so that the movement of one turtle impacts the movement of the other.

Read more
 

to

observer utilities

Begins a command procedure

Read more
 

to-report

utilities

Begin a procedure to create a custom reporter.

Read more
 

towards

turtles

Reports the angle of the caller towards an agent.

Read more
 

turtle

observer

Reports a specific turtle that has the provided unique number.

Read more
 

turtles

observer

Reports an agentset that contains all the turtles in a model.

Read more
 

turtles-here

turtles patches

Reports the agentset of all the turtles on a caller's patch.

Read more
 

turtles-own

observer

Declare a variable that belongs to turtles.

Read more
 

W back to top


while

observer

Begins a loop that runs as long as the reporter returns true.

Read more
 

with

observer turtles patches links

Reports a subset of the original agentset that only contains the agents with specified characteristics.

Read more