I am trying to make agents move through navigational nodes. This is my setup:
- Agents (let's say people/person) are located randomly into space.
- Nodes (just another kind of agent) are also located randomly into space.
- Each person defines a target node. A person should move to that target node through navigational nodes.
This is what I want to do:
- Each agent rotates toward a target node.
- Each agent has a vision range that would increase if the agent doesn't find any navigational node where to move.

Each agent moves to the closest navigational node, and starts the searching process again.
The agent stops when the closest navigational node is the target node. Then, the agent has arrived!
My questions:
I set the rotation of an agent using:
double r = Math.atan2( targetNode.getY() - this.getY(), targetNode.getX() - this.getX()); this.setRotation(r);I am not sure how to program the vision range in Anylogic. Any ideas?