| turtleSet | R Documentation |
turtle agentsetReport a turtle agentset containing all unique turtles provided in the inputs.
turtleSet(...)
## S4 method for signature 'agentMatrix'
turtleSet(...)
... |
|
Duplicated turtles are identified based only on their who numbers.
The turtle chosen for a who number is the first one given in the inputs.
To keep all turtles from the inputs, use NLset() to
reassign who numbers in some of the inputs, prior using
turtleSet(), to avoid turtles with duplicated who numbers.
AgentMatrix object containing all the unique turtles.
Sarah Bauduin
Wilensky, U. 1999. NetLogo. https://www.netlogo.org. Center for Connected Learning and Computer-Based Modeling, Northwestern University. Evanston, IL.
https://docs.netlogo.org/dictionary.html#turtle-set
w1 <- createWorld(minPxcor = 0, maxPxcor = 9, minPycor = 0, maxPycor = 9)
t1 <- createTurtles(n = 10, coords = randomXYcor(w1, n = 10), breed = "sheep")
t2 <- createTurtles(n = 2, coords = randomXYcor(w1, n = 2), breed = "wolf")
t2 <- NLset(turtles = t2, agents = t2, var = "who", val = c(10, 11))
t3 <- createTurtles(n = 1, coords = randomXYcor(w1, n = 1), breed = "sheperd")
t3 <- NLset(turtles = t3, agents = t3, var = "who", val = 12)
t4 <- turtleSet(t1, t2, t3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.