Search code examples
pathanylogicagent

How do I get the next node id/name along the path the agent is moving?


Assume that an agent is moving from Node1 to Node3 in the following network: Node1 - PathA - Node2 - PathB- Node3 How do I access the next node the agent will pass?

The actual task it for bus agents to move along the yellow paths and pickup/drop off passengers and crews at the corresponding stands (nodes) - one of the tasks requires me to acquire the "next node".

nodes and paths at airport


Solution

  • If you want full control of path-finding and nodes, check this tutorial. Fair warning: this is quite advanced and goes well beyond AnyLogic basics: https://www.benjamin-schumann.com/blog/2022/8/6/taking-control-of-your-network-agent-based-pathfinding