turtle | R Documentation |
turtles
Report the individuals among turtles
based on their who
numbers
and breed
.
turtle(turtles, who, breed)
## S4 method for signature 'agentMatrix,numeric,missing'
turtle(turtles, who)
## S4 method for signature 'agentMatrix,numeric,character'
turtle(turtles, who, breed)
turtles |
|
who |
Integer. Vector of the |
breed |
Characters. Vector of |
If no turtle
matches the given who
numbers, with potentially
one of the given
breed
, inside turtles
, then an empty agentMatrix
is returned.
If there are duplicates `who` numbers among the `turtles`, the first matching `turtle` with the requested `who` number is returned.
AgentMatrix
of the selected turtles
sorted in the order of
the who
numbers requested. If breed
was provided, the
turtles
selected are of one of the breed
.
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#turtle
w1 <- createWorld(minPxcor = 0, maxPxcor = 9, minPycor = 0, maxPycor = 9)
t1 <- createTurtles(n = 10, coords = randomXYcor(w1, n = 10))
t2 <- turtle(t1, who = 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.