Anylogic 道路交通库车道变更错误 [英] Anylogic Road Traffic Library Lane Change error

查看:115
本文介绍了Anylogic 道路交通库车道变更错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为公路系统建模,但出现此错误:

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

root.[3]:汽车未能改变车道(这是必要的继续移动)或到指定目的地的路线不能找到

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

完整的错误代码是:

java.lang.RuntimeException: root.[3]: Car failed to改变车道(这是继续移动所必需的)或前往目的地的路线找不到指定的目的地com.anylogic.engine.Engine.error(Unknown Source) atcom.anylogic.engine.Agent.error(Unknown Source) atcom.anylogic.engine.Utilities.error(Unknown Source) atcom.anylogic.libraries.road.C​​ar_xjal.error(来源不明)在com.anylogic.libraries.road.C​​ar_xjal.a(来源不明)com.anylogic.libraries.road.C​​ar_xjal.a(来源不明)com.anylogic.libraries.road.C​​ar_xjal.executeActionOf(来源不明)
在 com.anylogic.engine.TransitionMessage.execute(Unknown Source)
在 com.anylogic.engine.Engine.c(来源不明)在com.anylogic.engine.Engine.gc(来源不明)在com.anylogic.engine.Engine.a(来源不明)在com.anylogic.engine.Engine$i.run(来源不明)

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):

也就是说,有一个Select Output,用于选择汽车将移动到哪条道路.我相信 outWayNotFound 用于当汽车代理无法找到它想要移动的路径并且我设置它的方式是如果汽车想要走任何路径并且它没有找不到它,继续沿着它当前所在的路径前进.

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.

更新 1

发生错误时的RTL流程图截图:

Screenshot of the RTL flowchart when the error occurs:

推荐答案

这是一个有趣的问题,因为当您不熟悉它时,它是与道路交通库相关的常见概念问题之一.

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.

将模型分成多个carMoveTo"来定义汽车在道路网络中的轨迹几乎总是错误的.

如果可能,您应该始终避免这样做.造成此问题的原因有两个:

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

  1. 因为您创建的交叉路口被视为它将首先经过的道路的一部分.carMoveTo3 开始认为起点是小路的起点,但由于在不允许移动的车道上,它甚至无法启动移动.
  2. 因为当您启动新的 carMoveTo 时,如果交通过多,这些汽车在交叉路口时无法正确计算其他汽车的位置.这会导致车辆在交通拥堵时发生碰撞和行为异常.

如果您愿意,这两点都可以被视为 AnyLogic 错误,但是创建此道路库时认为应该以完全不同的方式使用它.(至少我认为是)

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)

那么正确的做法是什么?

好吧..你只需要 1 个 carMoveTo,移除 selectOutput 并定义汽车在 carMoveTo 之前或在 carMoveTo 本身中必须采取的路线.

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.

在 carMoveTo 中,您可以定义在路线不可行时要做什么的策略.

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:

在 carMoveTo 中,我会以 50% 的机会选择 road1 或 road2(这是执行您正在使用的 selectOutput 的正确方法).我不知道你如何选择要走的路,但你可以在那个地方定义.

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.

这篇关于Anylogic 道路交通库车道变更错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆