Search code examples
anylogic

How to set distance of the path in Anylogic?


I want to make several paths connecting several nodes and use 'MoveTo' block to move the agent. I want to define the movement by 'distance/speed' since the distance of paths are different. How can I set the distance of each path?

I looked for distance option in path, but i cannot find any.


Solution

  • in order to do this, you need to create the distances your own way, the easiest way is a LinkedHashMap in which the key will be the path, and the value will be the distance.... Then in the moveTo you can just use theHashMapName.get(pathName) to get the distance of the path

    Another option is to use instead of moveTo, use conveyor from the Process Modelling library, because with it, you can define the length of the conveyor, but it's uncertain if this will work in your case, but you can investigate it.