2

I am building an airport model with passengers spawning, shopping/eating and departing.

Most passengers rush to their GateArea (Polygonal Node) and wait there until they feel it is appropriate to engage in discretionary activities. When they think about leaving the GateArea they generate a "Eat"- or "Shop"- Goal" and are transferred into a PedGoTo-Block that is linked to the according shop. At this point I sometimes get the error:

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$1.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$9.onEnter(Unknown Source)
    at com.anylogic.libraries.processmodeling.InputBlock$1.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$1.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$1.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$1.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$2.a(Unknown Source)
    at com.anylogic.libraries.processmodeling.OutputBlock$2.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)

As you can see in the picture, neither the gate nor the shop are blocked by some static obstacles. The problem seem to be between the passengers, since they seem to block each other. I tried using less passengers per flight, which delayed the problem (or even solved it when I used very small numbers). However, the passenger numbers causing the problem are realistic (around 100) and so is the sizing of the GateArea.

Is there a way to tell passengers to "push" other agents to create a pathway or another way to solve the problem without lowering the numbers (and therefore compromising the simulation quality)?

Crowded Gate with error indication

PS. This is my first question on StackOverflow, so feel free to advise me on how to improve the question. I am hoping to get enough reputation to upvote the answers at other AnyLogic questions, since they helped more than once to overcome some deadlocks.

Jann
  • 23
  • 4

1 Answers1

1

Assuming that there really aren't any obstacles other than other pedestrians, then the parameter that can help improve your situation is the diameter of the pedestrian. Reducing it means that pedestrians can get closer to each other.

enter image description here

You can also change the diameter dynamically at any point of your simulation using ped.setDiameter( x ). So for example, you can set it to 0 at that specific point in time until the pedestrian leaves that area and change it back to 0.5.


Following the discussion in the comments, it appeared that the issue was not the diameter. Nonetheless, I am keeping it above as it might be the issue for someone facing a similar problem.

The real issue was that the modeler asking the question was making the agent leave the pedestrian flow chart using remove(agent). Once the agent is sent back to the flowchart using an Enter block, AnyLogic no longer recognizes that agent as a pedestrian present in the pedestrian network.

As such, instead of using Enter block, pedEnter should be used. The latter requires as input the location of the pedestrian's appearance. Since in your case the pedestrian is not really moving, just leaving the flowchart for modeling purposes, you can specify the location as the agent's current location as shown below.

enter image description here

Emile Zankoul
  • 2,161
  • 2
  • 6
  • 18
  • Thanks for your quick reply! Unfortunately, it doesn't solve my problem. I was not aware that it is possible to change it during the agents lifetime and played a bit with different diameters and Change-Diameter-Timepoints. Since I use a Fixed Seed, the problem always appears at the same model time. Changing the diameter or the number of agents influences the time of occurence, therefore both parameters must influence the problem. – Jann Feb 20 '22 at 21:03
  • Furthermore I learned, that it is not a general problem of entering a specific "ServiceWArea", since it sometimes, but not always happens when the first agents wants to enter. Additionally it does not always happen with the same ServiceWArea, so it is not tied to a specific one (but with small diameter/nr of agents it is possible, that they will successfully use all of them with the problem appearing later in that run). Sometimes the agent really seem to be blocked by other agents (they are blocking the shortest way), but sometimes the shortest path appears fee when the engine stops. – Jann Feb 20 '22 at 21:07
  • Feel free to upload the model – Emile Zankoul Feb 20 '22 at 22:02
  • Unfortunately, the model includes confidential data that can't be made public. However, while trying to reproduce the error in a reduced environment, I found my the problem: In my model, the agents move through a flowchart (located in main) that controls their movements (similiar to one example model). The transitions between flowchartblocks are partly time-controlled, movement-controlled or from the statechart within the agent (when the agents generates a new goal). – Jann Feb 22 '22 at 09:41
  • The problem occured, when an agent tried to leave a **PolygonalNode** (tied to a PedWait block) and enter a **PedGoTo** block. In the model, I canceled the **PedWait** Block with `PedWait.remove(agent)` and re-entered the agent elsewhere. It seems, that the `remove()` fuction does not free the agent from waiting in **PedWait**, but when I use the cancel-port instead `PedWait.cancel(agent)`, the agents are able to leave the block via the connechted line. If there is a way to solve the situation with `remove(agent)` and re-Entering it, I'd prefer that, but anyways, thanks a lot for your help! – Jann Feb 22 '22 at 09:50
  • I'm wondering how you're using PedWait.remove(agent), when you are dealing with pedestrians (so ped instead of agent). Where are you writing this code? – Emile Zankoul Feb 22 '22 at 10:48
  • I am quite new to anylogic, so it might well be, that my design choices are a bit "off". Most of the code that specifies agent behavior is written within the agent (observing environment, generating goals, making decisions on what to do next). But the actual physical movements are controlled by a flowchart within the `main` agent. The exact lines I was using (producing the error) are as follows. They are in a state transition of the statechart from an agent that I use as ped. `PedWait d = PedWait.class.cast(this.currentBlock());` `d.remove(this);` `get_Main().E_reEnter.take(this);` – Jann Feb 22 '22 at 11:01
  • Okay. I think I see what your issue is. You need to use a pedEnter, not a regular enter. Are you using that? – Emile Zankoul Feb 22 '22 at 11:22
  • 1
    Thanks for that remark! It took me a few tries to figure out, how to get the `pedEnter` to work properly. But with the settings "Appears at point (x,y), "X: `ped.getX()`", "Y: `ped.getY()`" within the `pedEnter`-block, it works for me. Additionally, I use a fixed diameter, since it is not really relevant and the walking speed is a parameter inside the agents, accessible via `ped.p_walkingSpeed`. Therefore the pedestrians seem to show a reasonable and stable behavior. Thanks again for your help! – Jann Feb 22 '22 at 15:27
  • 1
    Indeed, the trick is to update the location of the pedestrian since you have no choice but to specify a location of arrival. Getting the agent's current X and Y position resolves it. I will update my answer for future reference. – Emile Zankoul Feb 22 '22 at 15:28
  • 1
    I've updated the answer. I think now it reflects your issue in case someone in the future faces a similar problem. – Emile Zankoul Feb 22 '22 at 15:33