Search code examples
anylogic

How to restrict pedestrian access to a polygonal node indefinitely after the pedestrian has been denied access initially?


I am creating an evacuation model with the following layout:

enter image description here

I have been able to code the pedestrians to go to the nearest available exit relative to their current position and have created a 'congestion zone' using a polygonal node with an access restriction which allows a capacity of 7 pedestrians at any given time. Assuming both exits are available, any pedestrians approaching this zone from room3 or room4 will be heading towards exit1 as this is the closest exit. However, I have also added an 'On enter denied' command that triggers when the pedestrian tries to enter when the zone is at full capacity which cancels the pedestrian's initial goTo block target destination (exit1 in this case) and uses the exit port to change to another goTo block which obtains the next closest exit (exit2). This is to simulate the pedestrian realising that this route is too congested and that it would be best for them to try another exit.

The node properties:

enter image description here

The flowchart:

enter image description here

The issue is that although the pedestrians do change their target destination to exit2, they take the following route to get there:

enter image description here

I believe this occurs as this would be the shortest route for the pedestrian to take distance-wise. However, logically, the route that they should take if they are trying to avoid the congestion is the following:

enter image description here

How can pedestrians who have been denied entry to the congestion zone be programmed to take the second route as opposed to the first route shown above? Is there perhaps any way to make them treat the zone as a wall so that they have no other choice but to take the second route?


Solution

  • You cannot manually prescribe their routing, this is hard-coded into the library. But you can employ additional pathways and PedToGo blocks to "nudge" them where you want them to go.

    PS: pls upvote helpful answers as this helps future users with similar problems to find solutions faster, see https://stackoverflow.com/help/why-vote