sprout | R Documentation |
turtles
Create n
new turtles
on specific patches
.
sprout(n, patches, breed, heading, color, turtles)
## S4 method for signature 'numeric,matrix'
sprout(n, patches, breed, heading, color, turtles)
n |
Integer. Vector of length 1 or of length the number of |
patches |
Matrix ( |
breed |
Character. Vector of |
heading |
Numeric. Vector of values between 0 and 360.
Must be of length 1 or of length the number of |
color |
Character. Vector of |
turtles |
|
nrow(patches)
must be equal to 1 or to n
.
If `turtles` is provided, the new `turtles` are added to the `turtles` when returned. The `who` numbers of the sprouted `turtles` therefore follow the ones from the `turtles`. All new sprouted `turtles` are placed at the end of the `agentMatrix` object. If no `turtles` is provided, a new `agentMatrix` is created and the `who` numbers start at 0. If `turtles` is provided and had additional variables created with `turtlesOwn()`, `NA` is given for these variables for the new sprouted `turtles`.
AgentMatrix
including the new
sprouted turtles
.
Sarah Bauduin
Wilensky, U. 1999. NetLogo. http://ccl.northwestern.edu/netlogo/. Center for Connected Learning and Computer-Based Modeling, Northwestern University. Evanston, IL.
https://ccl.northwestern.edu/netlogo/docs/dictionary.html#sprout
t1 <- sprout(patches = cbind(pxcor = 2, pycor = 2), n = 3)
t2 <- sprout(patches = cbind(pxcor = 3, pycor = 3), n = 3, turtles = t1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.