From what I can see, the cars choose their path based on shortest distance, as soon as the "carMoveTo" command occurs.
First question: How is the parameter for getting the road length called? Unlike in Paths, where you can simply call path.length()
, there is nothing simple as that (obviously, inward lanes in curved paths have shorter length).
Second question: Is there a simple or hard way to change the logic of routing? I have found this article on path network https://florianhuebler.com/custom-routing-in-anylogic/ , but have no clue how to put that into road traffic.
Third question: Does the "average speed" consider average speed of current cars on road? That's not what I would really want - my preferred way of routing would be to only take the speed limit stoplines into consideration (In that sense, I guess the car's maximum speed would also need to be checked - if it drives 50 kph at max, then it will not care about 80 kph limit). Does there exist a way to do it easily?
(Side-question - what is the average speed on unused road? Road network descriptor colors it as greenest.)