Report the distances between
NLdist(agents, agents2, world, torus = FALSE, allPairs = FALSE) # S4 method for matrix,matrix NLdist(agents, agents2, world, torus = FALSE, allPairs = FALSE)
Logical to determine if the
Logical. Only relevant if the number of agents/locations in
Numeric. Vector of distances between
one agent/location, or if
agents2 contained the same
number of agents/locations and
allPairs = FALSE, or
Matrix of distances between
agents (rows) and
agents2 are of different lengths,
or of same length
allPairs = TRUE.
Distances from/to a patch are measured from/to its center.
torus = FALSE,
world does not need to be provided.
torus = TRUE, a distance around the sides of the
reported only if smaller than the one across the
Wilensky, U. 1999. NetLogo. http://ccl.northwestern.edu/netlogo/. Center for Connected Learning and Computer-Based Modeling, Northwestern University. Evanston, IL.
w1 <- createWorld(minPxcor = 0, maxPxcor = 9, minPycor = 0, maxPycor = 9) NLdist(agents = patch(w1, 0, 0), agents2 = patch(w1, c(1, 9), c(1, 9)))#>  1.414214 12.727922#>  1.414214 1.414214t1 <- createTurtles(n = 2, coords = randomXYcor(w1, n = 2)) NLdist(agents = t1, agents2 = patch(w1, c(1,9), c(1,9)), allPairs = TRUE)#> [,1] [,2] #> [1,] 5.788794 6.157289 #> [2,] 1.110956 11.564960