When a person agent is absorbing one node, I am trying to find the list/array of other nodes (point node) around him within a certain diameter range (let's say 10feet). Is there any built-in function to sort those nodes around the agent? I was trying "agentInRange", "getNearestAgent" but those aren't actually the right ones for my need as these functions return a list of person agent within the range not the list of nodes around him. How I can get the list of nodes (point node) around an agent? Thanks.
Asked
Active
Viewed 173 times
1 Answers
1
Not that I know of.
But you can easily put all nodes in your model into a collection, then let your agents loop across that collection to check. Something like this, will need to be adjusted to your needs and conditions
for (PointNode currentNode : col_AllNodes) {
if (currentNode.getX() ...) { // check your condition
return true;
}
}
You can easily put all nodes into a collection by selecting them all, right-click and then selected "create collection" as below:

Benjamin
- 10,603
- 3
- 16
- 28
-
Thanks, Ben! this is one good idea which I already tried. Ideally, it should work fine but for some weird reason, some nodes are missing. I think I have some glitch in my code, which I am trying to find out. However, thanks for your suggestion! – Tariq Oct 08 '20 at 07:01
-
well, make sure all nodes are in that collection. And put in some tracelns to check in detail what "is missing" :) – Benjamin Oct 08 '20 at 07:31