City Primitives

Turtle-Related Primitives

add-to-agentset manhattan-distance

Patch-Related Primitives

add-to-agentset manhattan-distance neighbors-nowrap neighbors4-nowrap

Agentset-Related Primitives

add-to-agentset bordering-patches empty-patch-set empty-turtle-set lower-percent-of on-radius remove-from-agentset upper-percent-of

Boolean Primitives

bitwise-and bitwise-not bitwise-or

Vector Primitives

cross dot magnitude normalize scalar-divide scalar-multiply vector-add vector-subtract

Vision Primitives

in-front-of in-frustum-of in-view-of

Image Analysis

laplacian laplacian4 laplacian-center laplacian-neighbors __prewitt __roberts __robinson __sobel

Math Primitives

sign

A

add-to-agentset

add-to-agentset agent agentset
add-to-agentset agentset agentset

Similar in behavior to lput except that this function modifies agentsets. Returns the union of an agent or agentset with another agentset. The agent or agentset must be of the same agent type as that of the agentset it is added to.

B

bitwise-and

integer bitwise-and integer

Returns the bitwise and of the integers.

bitwise-not

integer bitwise-not integer

Returns the bitwise not of the integers.

bitwise-or

integer bitwise-or integer

Returns the bitwise or of the integers.

bordering-patches

bordering-patches patch-set

Returns the patches that immediately neighbor the patches of a given patch-set. It's equivalent to taking the difference between the given patch-set, and the union of neighbors of the given patch-set.

C

cross

list-1 cross list-2

Returns the three-dimensional cross product of lists 1 and 2. Both lists must be in 3 dimensions and consist of numbers.

D

dot

list-1 dot list-2

Returns the dot-product of lists 1 and 2. Both lists must consist of numbers.

E

empty-patch-set

empty-patch-set

Returns an empty set that is used to hold patches. This is useful when comparing patch sets to an empty set or creating an initial set that will be filled in later by successive calls to add-to-agentset.

empty-turtle-set

empty-turtle-set

Returns an empty set that is used to hold turtles. This is useful when comparing turtle sets to an empty set or creating an initial set that will be filled in later by successive calls to add-to-agentset.

I

in-front-of

agentset in-front-of turtle

Returns all the patches that are within the positive half space that is defined by the orientation of the turtle's heading and position, i.e. it returns all patches that are in front of the given turtle. This view is limited to a non-wrapping world.

in-frustum-of

agentset in-frustum-of turtle field-of-view depth

Returns all the patches that are within the viewing frustum defined by the turtle's heading, position, field of view, and depth limit. This function supports wrapping. Note that the wider the field-of-view, the more expensive the function call.

in-view-of

agentset in-view-of turtle field-of-view

Returns all the patches that are within the viewing frustum defined by the turtle's heading, position, and field of view. This function assumes an "infinite" viewing depth, but is limited to a non-wrapping world.

L

laplacian

laplacian [ reporter ]

Returns the laplacian value of a given reporter using values returned by a patch's eight neighbors. This is useful when analyzing patch variables.

laplacian4

laplacian4 [ reporter ]

Returns the laplacian value of a given reporter using values returned by a patch's four neighbors. This is useful when analyzing patch variables.

laplacian-center

laplacian-center [ reporter ]

Returns the laplacian value of a given reporter using values returned by a patch's eight neighbors. Weighting is focused on the center patch (calling patch).

laplacian-neighbors

laplacian-neighbors [ reporter ]

Returns the laplacian value of a given reporter using values returned by a patch's eight neighbors. Weighting is focused on the neighboring patches.

lower-percent-of

lower-percent-of agentset percent [ reporter ]

Returns the agents whose reported values fall within the lower percentage of all values that were returned by the given agentset.

M

magnitude

magnitude list

Returns the magnitude of a list. The list must comprise entirely of numbers.

manhattan-distance

manhattan-distance agent-1 agent-2

Returns the manhattan distance between agents 1 and 2. The manhattan distance is equal to the sum of the absolute distances in the x and y dimensions.

N

neighbors-nowrap

neighbors-nowrap

Returns the eight neighbors of a patch, but does not support a wrapping world.

neighbors4-nowrap

neighbors4-nowrap

Returns the four neighbors of a patch, but does not support a wrapping world.

normalize

normalize list

Returns a normalized list (unit vector) of a given dimension. The components of the list must be numbers.

O

on-radius

agentset on-radius radius

Returns the agents at a specified distance from the calling agent. The function is designed to give exclusive results according to successive calls with an integral radius.

P

__prewitt

__prewitt [ reporter ]

Returns a patch's value after it has been convolved with its neighboring patches according to the Prewitt kernel.

R

remove-from-agentset

remove-from-agentset agent agentset
remove-from-agentset agentset agentset

Returns an agentset with the agent, or any agents in the first set, that coexist in the second set removed.

__roberts

__roberts [ reporter ]

Returns a patch's value after it has been convolved with its neighboring patches according to the Roberts kernel.

__robinson

__robinson [ reporter ]

Returns a patch's value after it has been convolved with its neighboring patches according to the Robinson kernel.

S

scalar-divide

scalar-divide list number

Divides all of the elements of a given list by a scalar value. All elements of the list must be numeric.

scalar-multiply

scalar-multiply number list

Multiplies all of the elements of a given list by a scalar value. All elements of the list must be numeric.

sign

sign number

Returns the sign of a number: 1 if positive, -1 if negative, and 0 if neither.

__sobel

__sobel [ reporter ]

Returns a patch's value after it has been convolved with its neighboring patches according to the Sobel kernel.

U

upper-percent-of

upper-percent-of agentset percent [ reporter ]

Returns the agents whose reported values fall within the upper percentage of all values that were returned by the given agentset.

V

vector-add

vector-add list-1 list-2

Returns a list that results when lists 1 and 2 are added together element by element. Lists 1 and 2 must consist entirely of numbers.

vector-subtract

vector-subtract list-1 list-2

Returns a list that results when lists 2 is subtracted element by element from list 1. Lists 1 and 2 must consist entirely of numbers.