Anylogic Road Traffic Library Lane Change error

本秂侑毒 提交于 2019-12-23 17:01:58

问题


I am trying to model a highway system of roads but I am getting this error:

root.<population>[3]: Car failed to change lane (that was necessary to continue movement) or route to the specified destination cannot be found

The full error code is:

java.lang.RuntimeException: root.<population>[3]: Car failed to change lane (that was necessary to continue movement) or route to the specified destination cannot be found at com.anylogic.engine.Engine.error(Unknown Source) at com.anylogic.engine.Agent.error(Unknown Source) at com.anylogic.engine.Utilities.error(Unknown Source) at com.anylogic.libraries.road.Car_xjal.error(Unknown Source) at com.anylogic.libraries.road.Car_xjal.a(Unknown Source) at com.anylogic.libraries.road.Car_xjal.a(Unknown Source) at com.anylogic.libraries.road.Car_xjal.executeActionOf(Unknown Source)
at com.anylogic.engine.TransitionMessage.execute(Unknown Source)
at com.anylogic.engine.Engine.c(Unknown Source) at com.anylogic.engine.Engine.gc(Unknown Source) at com.anylogic.engine.Engine.a(Unknown Source) at com.anylogic.engine.Engine$i.run(Unknown Source)

Here is my setup (space markup screenshot with error):

The way it is setup is(screenshot of logic):

That is, there is an Select Output which selects which road the car will move to. I believe that the outWayNotFound is used when the car agent is not able to find the path it wants to move to and the way I have set it up is if the car wants to take any path and it doesn't find it, just continue on path that it currently is in.

I am not sure what the error signifies here as I think I have covered my bases here. What am I missing? Any help will be highly appreciated.

Update 1

Screenshot of the RTL flowchart when the error occurs:


回答1:


This is an interesting question because it's one of the common conceptual problems associated with the road traffic library when you are not familiar with it.

It is almost always an error to divide your model into multiple "carMoveTo" to define the trajectory of a car in a road network.

If possible, you should always avoid doing this. There are 2 reasons why this is a problem:

  1. Because the intersection that you created is considered part of the road that it will follow first. carMoveTo3 begins thinking that the start point is the beginning of the small road, but since it's in a lane that doesn't allow the movement, it cannot even start the movement.
  2. Because when you start a new carMoveTo, if there is too much traffic, the cars are not able to correctly calculate where the other cars are while they are in the intersection. This results in the cars colliding and behaving erratically if there is traffic.

Both points can be considered an AnyLogic bug if you want, but this road library was created thinking that it should be used in a completely different way. (At least I think it was)

So what is the correct way of doing this?

Well.. you need to have only 1 carMoveTo, removing the selectOutput and defining what route the car must take before carMoveTo or in the carMoveTo itself.

And in carMoveTo you can the define a strategy of what to do when the route is not possible.

Here is how I would make your model:

In carMoveTo I would select road1 or road2 with 50% chances (which is the correct way of doing the selectOutput that you are using). I don't know how you choose the road to take, but you can define in that place.




回答2:


The simplest fix is to give cars enough time to switch to the correct lane by simply stretching the incoming road: in the case above, just extend the road towards the south further so cars have enough time to switch to their required lane.

https://www.benjamin-schumann.com/blog/2016/5/15/using-the-anylogic-road-traffic-library-for-good



来源:https://stackoverflow.com/questions/53547205/anylogic-road-traffic-library-lane-change-error

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!