AnyLogic:基于代理的仿真中无法到达的目标
AnyLogic: Unreachable Target in Agent-Based-Simulation
我正在构建一个机场模型,其中有乘客生成、shopping/eating 和离开。
大多数乘客赶到他们的 GateArea(多边形节点)并在那里等待,直到他们觉得适合进行自由活动。当他们考虑离开 GateArea 时,他们会生成一个“Eat”- 或“Shop”- Goal”,并被转移到链接到相应商店的 PedGoTo-Block。此时我有时会收到错误消息:
java.lang.RuntimeException: root.pGT_F_B2.pedGoToTarget:
Unreachable target: (599.37, 398.48) on level 'name: level' for pedestrian 'id: 46' located at: (467.15, 222.68) on level 'name: level'!
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.pedestrian.PedBlock_xjal.error(Unknown Source)
at com.anylogic.libraries.pedestrian.PedGoTo_xjal.d(Unknown Source)
at com.anylogic.libraries.pedestrian.PedGoTo_xjal.c(Unknown Source)
at com.anylogic.libraries.pedestrian.PedGoTo_xjal.g(Unknown Source)
at com.anylogic.libraries.pedestrian.PedGoTo_xjal.f(Unknown Source)
at com.anylogic.libraries.pedestrian.PedGoTo_xjal.d(Unknown Source)
at com.anylogic.libraries.pedestrian.PedGoTo_xjal.a(Unknown Source)
at com.anylogic.libraries.pedestrian.PedGoTo_xjal.a(Unknown Source)
at com.anylogic.libraries.pedestrian.PedGoTo_xjal.onEnter(Unknown Source)
at com.anylogic.libraries.processmodeling.Delay.b(Unknown Source)
at com.anylogic.libraries.processmodeling.Delay.b(Unknown Source)
at com.anylogic.libraries.processmodeling.Delay.onEnter(Unknown Source)
at com.anylogic.libraries.processmodeling.InputBlock.b(Unknown Source)
at com.anylogic.libraries.processmodeling.InPort.a(Unknown Source)
at com.anylogic.libraries.processmodeling.InPort.receiveImmediately(Unknown Source)
at com.anylogic.libraries.processmodeling.InputBlock.a(Unknown Source)
at com.anylogic.libraries.processmodeling.OutPort.a(Unknown Source)
at com.anylogic.libraries.processmodeling.OutPort.b(Unknown Source)
at com.anylogic.libraries.processmodeling.PlainTransfer.a(Unknown Source)
at com.anylogic.libraries.processmodeling.OutPort.a(Unknown Source)
at com.anylogic.libraries.processmodeling.OutPort.b(Unknown Source)
at com.anylogic.libraries.processmodeling.OutputBlock.forwardReadyEntityNotification(Unknown Source)
at com.anylogic.libraries.processmodeling.InputBlock.a(Unknown Source)
at com.anylogic.libraries.processmodeling.OutPort.a(Unknown Source)
at com.anylogic.libraries.processmodeling.OutPort.b(Unknown Source)
at com.anylogic.libraries.processmodeling.OutPort.a(Unknown Source)
at com.anylogic.libraries.processmodeling.OutputBlock.a(Unknown Source)
at com.anylogic.libraries.processmodeling.OutputBlock.a(Unknown Source)
at com.anylogic.libraries.processmodeling.OutputBlock.a(Unknown Source)
at com.anylogic.libraries.processmodeling.OutputBlock.action(Unknown Source)
at com.anylogic.libraries.processmodeling.AsynchronousExecutor_xjal$a.execute(Unknown Source)
at com.anylogic.engine.LibraryEventHandler$b.execute(Unknown Source)
at com.anylogic.engine.Engine.c(Unknown Source)
at com.anylogic.engine.Engine.fi(Unknown Source)
at com.anylogic.engine.Engine.n(Unknown Source)
at com.anylogic.engine.Engine$b.run(Unknown Source)
如图所示,大门和店铺都没有被一些静态障碍物挡住。问题似乎出在乘客之间,因为他们似乎互相挡住了。我尝试在每次飞行中使用更少的乘客,这延迟了问题(或者甚至在我使用非常小的数字时解决了问题)。但是,导致问题的乘客人数是现实的(大约 100 人),GateArea 的大小也是如此。
有没有办法告诉乘客“推动”其他代理人创建路径或其他方法来解决问题而不降低数字(从而影响模拟质量)?
Crowded Gate with error indication
PS。这是我在 Whosebug 上的第一个问题,请随时就如何改进问题向我提出建议。我希望获得足够的声誉来支持其他 AnyLogic 问题的答案,因为它们不止一次帮助克服了一些僵局。
假设除了其他行人之外真的没有任何障碍物,那么可以帮助改善你的情况的参数是行人的直径。减少它意味着行人可以彼此靠近。
您还可以使用 ped.setDiameter( x ) 在模拟的任何点动态更改直径。因此,例如,您可以在特定时间点将其设置为 0,直到行人离开该区域并将其更改回 0.5。
经过评论中的讨论,问题似乎不是直径。尽管如此,我还是将其保留在上面,因为对于面临类似问题的人来说,这可能是个问题。
真正的问题是建模者提出的问题是让代理使用 remove(agent)
离开行人流程图。使用 Enter
块将代理发送回流程图后,AnyLogic 不再将该代理识别为行人网络中的行人。
因此,不应使用 Enter
块,而应使用 pedEnter
。后者需要行人出现的位置作为输入。由于在您的情况下行人并没有真正移动,只是为了建模目的而留下流程图,您可以将位置指定为代理的当前位置,如下所示。
我正在构建一个机场模型,其中有乘客生成、shopping/eating 和离开。
大多数乘客赶到他们的 GateArea(多边形节点)并在那里等待,直到他们觉得适合进行自由活动。当他们考虑离开 GateArea 时,他们会生成一个“Eat”- 或“Shop”- Goal”,并被转移到链接到相应商店的 PedGoTo-Block。此时我有时会收到错误消息:
java.lang.RuntimeException: root.pGT_F_B2.pedGoToTarget:
Unreachable target: (599.37, 398.48) on level 'name: level' for pedestrian 'id: 46' located at: (467.15, 222.68) on level 'name: level'!
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.pedestrian.PedBlock_xjal.error(Unknown Source)
at com.anylogic.libraries.pedestrian.PedGoTo_xjal.d(Unknown Source)
at com.anylogic.libraries.pedestrian.PedGoTo_xjal.c(Unknown Source)
at com.anylogic.libraries.pedestrian.PedGoTo_xjal.g(Unknown Source)
at com.anylogic.libraries.pedestrian.PedGoTo_xjal.f(Unknown Source)
at com.anylogic.libraries.pedestrian.PedGoTo_xjal.d(Unknown Source)
at com.anylogic.libraries.pedestrian.PedGoTo_xjal.a(Unknown Source)
at com.anylogic.libraries.pedestrian.PedGoTo_xjal.a(Unknown Source)
at com.anylogic.libraries.pedestrian.PedGoTo_xjal.onEnter(Unknown Source)
at com.anylogic.libraries.processmodeling.Delay.b(Unknown Source)
at com.anylogic.libraries.processmodeling.Delay.b(Unknown Source)
at com.anylogic.libraries.processmodeling.Delay.onEnter(Unknown Source)
at com.anylogic.libraries.processmodeling.InputBlock.b(Unknown Source)
at com.anylogic.libraries.processmodeling.InPort.a(Unknown Source)
at com.anylogic.libraries.processmodeling.InPort.receiveImmediately(Unknown Source)
at com.anylogic.libraries.processmodeling.InputBlock.a(Unknown Source)
at com.anylogic.libraries.processmodeling.OutPort.a(Unknown Source)
at com.anylogic.libraries.processmodeling.OutPort.b(Unknown Source)
at com.anylogic.libraries.processmodeling.PlainTransfer.a(Unknown Source)
at com.anylogic.libraries.processmodeling.OutPort.a(Unknown Source)
at com.anylogic.libraries.processmodeling.OutPort.b(Unknown Source)
at com.anylogic.libraries.processmodeling.OutputBlock.forwardReadyEntityNotification(Unknown Source)
at com.anylogic.libraries.processmodeling.InputBlock.a(Unknown Source)
at com.anylogic.libraries.processmodeling.OutPort.a(Unknown Source)
at com.anylogic.libraries.processmodeling.OutPort.b(Unknown Source)
at com.anylogic.libraries.processmodeling.OutPort.a(Unknown Source)
at com.anylogic.libraries.processmodeling.OutputBlock.a(Unknown Source)
at com.anylogic.libraries.processmodeling.OutputBlock.a(Unknown Source)
at com.anylogic.libraries.processmodeling.OutputBlock.a(Unknown Source)
at com.anylogic.libraries.processmodeling.OutputBlock.action(Unknown Source)
at com.anylogic.libraries.processmodeling.AsynchronousExecutor_xjal$a.execute(Unknown Source)
at com.anylogic.engine.LibraryEventHandler$b.execute(Unknown Source)
at com.anylogic.engine.Engine.c(Unknown Source)
at com.anylogic.engine.Engine.fi(Unknown Source)
at com.anylogic.engine.Engine.n(Unknown Source)
at com.anylogic.engine.Engine$b.run(Unknown Source)
如图所示,大门和店铺都没有被一些静态障碍物挡住。问题似乎出在乘客之间,因为他们似乎互相挡住了。我尝试在每次飞行中使用更少的乘客,这延迟了问题(或者甚至在我使用非常小的数字时解决了问题)。但是,导致问题的乘客人数是现实的(大约 100 人),GateArea 的大小也是如此。
有没有办法告诉乘客“推动”其他代理人创建路径或其他方法来解决问题而不降低数字(从而影响模拟质量)?
Crowded Gate with error indication
PS。这是我在 Whosebug 上的第一个问题,请随时就如何改进问题向我提出建议。我希望获得足够的声誉来支持其他 AnyLogic 问题的答案,因为它们不止一次帮助克服了一些僵局。
假设除了其他行人之外真的没有任何障碍物,那么可以帮助改善你的情况的参数是行人的直径。减少它意味着行人可以彼此靠近。
您还可以使用 ped.setDiameter( x ) 在模拟的任何点动态更改直径。因此,例如,您可以在特定时间点将其设置为 0,直到行人离开该区域并将其更改回 0.5。
经过评论中的讨论,问题似乎不是直径。尽管如此,我还是将其保留在上面,因为对于面临类似问题的人来说,这可能是个问题。
真正的问题是建模者提出的问题是让代理使用 remove(agent)
离开行人流程图。使用 Enter
块将代理发送回流程图后,AnyLogic 不再将该代理识别为行人网络中的行人。
因此,不应使用 Enter
块,而应使用 pedEnter
。后者需要行人出现的位置作为输入。由于在您的情况下行人并没有真正移动,只是为了建模目的而留下流程图,您可以将位置指定为代理的当前位置,如下所示。