Learn R Programming

RNetLogo (version 0.9.2)

NLSetPatches: Function to set a patch variable of all patches of the NetLogo world to the values of a matrix.

Description

NLSetPatches is an easy-to-use way to set the values of all patches (NetLogo world) to the values of a matrix.

Usage

NLSetPatches(patch.var, in.matrix, nl.obj=NULL)

Arguments

patch.var
The name of the patch variable which should be set to the values of the matrix.
in.matrix
A matrix which is a representation of the NetLogo world (= same dimension).
nl.obj
(optional) A variable holding a reference to a NetLogo instance created with NLStart.

Value

  • No return value.

Details

The matrix must have the same x- and y-dimension as the NetLogo world with indices beginning with (1,1). The upper-left cell (1,1) of the matrix represents the upper-left patch of the NetLogo world independent of the origin of the NetLogo world.

See Also

NLReport, NLGetAgentSet, NLGetGraph, NLDfToList

Examples

Run this code
NLStart("C:/Program Files/NetLogo 4.1.3")
m1 <- matrix(1:1089 , 33)
NLSetPatches(m1, "pcolor")

Run the code above in your browser using DataLab