Queuing in PD

All topics related to questions in Pedestrian Dynamics
BPeter
Posts: 11
Joined: Sunday 26 October, 2014 - 23:54

Re: Queuing in PD

Post by BPeter »

I studied the following code:

Do(
Case(
{ first check the location id of the current dest of the agent. }
ActivityLocation_GetID( Agent_GetDestination( i, 1))-9,

{ then send the agent into the corresponding corridor }
PD_Agent_FollowIndicativeRoute(i, 7, 0, 2),
PD_Agent_FollowIndicativeRoute(i, 8, 0, 2),
PD_Agent_FollowIndicativeRoute(i, 9, 0, 2)
)
)


This is the one that’s in the exit trigger of the Action Area of the multiple_queue_checkin_v02.mod that you attached a few posts earlier. I mentioned that I wanted to reproduce the same model with no success. Now I managed to make it work correctly by changing the „-9” to „-7” at the end of the ActivityLocation_GetID row in my model.


What does that -9 refer to? It’s obviously related to the location ID’s, but how?? How does this code find the corresponding corridor? Or in other words, how do I send the agent to a corridor with a specific ID based on its current destination?

(See the models attached)

Thanks,
Peter
Attachments
3_desks_model.mod
This is my model
(94.37 KiB) Downloaded 240 times
multiple_queue_checkin_v02.mod
This is your example model
(94.2 KiB) Downloaded 253 times
ie_1989
Posts: 58
Joined: Saturday 21 November, 2015 - 06:50

Re: Queuing in PD

Post by ie_1989 »

Hi
I'm trying to simulate the movement of passengers in a train station, focusing on the moment they want to get on the train and exit the station.
I found a similar model in the Example Models of PD, named "station platform 2" and tried to make a model similar to it as much as possible. In the mentioned model, the train is modeled as an "Exit" which is not always available. When it becomes available, it triggers the passengers who was waiting in a "waiting area" to move into the train, and they move and exit the station. Whereas in my model, they keep waiting in the waiting area for EVER !!!
I have attached both files "station platform 2" and my file "cc1". Please help me trigger the agents in the waiting area
Attachments
cc1.mod
(68.06 KiB) Downloaded 186 times
station platform 2.mod
(83.72 KiB) Downloaded 190 times
marlies
Posts: 301
Joined: Monday 17 January, 2011 - 09:28

Re: Queuing in PD

Post by marlies »

Hi,

You missed a tiny, but in this case important step: on the train exit the option "Store approaching agents" needs to be selected. See the tab Location.

Why: in the availability control the model uses the function ActivityLocation_TriggerAllApproachingAgents to trigger the agents that are approaching. But by default the simulation will not keep track of the agents that are approaching an activity (the simulation run will be faster when it doesn't keep track of this info), in this case this info is required therefore this option needs to be selected.

Regards, Marlies
ie_1989
Posts: 58
Joined: Saturday 21 November, 2015 - 06:50

Re: Queuing in PD

Post by ie_1989 »

Thank you so much Marlie. Actually it works. ;)
ie_1989
Posts: 58
Joined: Saturday 21 November, 2015 - 06:50

Re: Queuing in PD

Post by ie_1989 »

I have another problem. I want to combine the example models "station platform 2" and "station platform 1" with each other. In other words, I want to model getting off and getting on a train simultaneously. The train is not available all the times, so when in becomes available, the agents of the train (red ones in my model) tries to exit from it, meanwhile the waiting agents (the blue ones) wants to get on it.
In modeling this procedure, I ran into a problem with agents exiting the train (Entry/Exit location). My problem is that they exit without considering the availability of the train. What can I do to solve this issue?
(I have attached my Model, named "project_2" and also the 2 mentioned example models)
Attachments
station platform 1.mod
(78.69 KiB) Downloaded 175 times
station platform 2.mod
(83.72 KiB) Downloaded 162 times
project_2.mod
(76.48 KiB) Downloaded 162 times
marlies
Posts: 301
Joined: Monday 17 January, 2011 - 09:28

Re: Queuing in PD

Post by marlies »

Hi,

I would suggest to make two separate Agent_Generators instead of just one:

1. a generator for departing passengers. This generator releases agents randomly over time (using the delay). They wait in the waiting area until they get triggered by the train.
2. the other generator for arriving passengers. The schedule for this generator matches the schedule of the entry/exit availability. So, when the train entry/exit has a train every 5 minutes, the agent generator also generates agents every 5 minutes. Because those times match each other arriving agents do not have to wait until they get triggered.

Regards, Marlies
ie_1989
Posts: 58
Joined: Saturday 21 November, 2015 - 06:50

Re: Queuing in PD

Post by ie_1989 »

Again thank you very much Marlies... It was really a nice trick. :)
ie_1989
Posts: 58
Joined: Saturday 21 November, 2015 - 06:50

Re: Queuing in PD

Post by ie_1989 »

In continue to my previous posts, I want to model pedestrians in a subway station having 2 lines for 2 trains (the PD file name is "project7"). Before modeling this, I modeled a 1-train subway station in which the passengers get on and get of the train simultaneously, which works correctly (the PD file name is "project6"). But when I add the other train (and other entries and waiting areas) the model runs into lots of errors. I have created 4 profiles and used 4 separate generators to generate passengers (2 generators for platform1 and 2 for platform2).
In platform1 passengers wait in the waiting area till the train (exit area) becomes available but they don't move and stay for ever. The issue is more complex in platform2 as the passengers get stuck in the entries and can't even leave the entries located in platform2.
I have attached my files (project6 and project7). Please help me with the problem.
Thanks a lot in advance :)
Attachments
project7.mod
(124.4 KiB) Downloaded 173 times
project6.mod
(84.2 KiB) Downloaded 167 times
marlies
Posts: 301
Joined: Monday 17 January, 2011 - 09:28

Re: Queuing in PD

Post by marlies »

Hi,

I run your model nr 7 and get a lot of errors saying:

PD error 1001: Invalid start location

This 1001 error means that you want to generate agents at a location that is not inside the walkable space. To check the available walkable space you can do the following: go to the menu Display, then click Walkable space. This will visualize all the walkable space in light blue. Doing this you'll see that EntryExit_8 which you used to model the 2nd platform is outside the walkable space. To solve that problem you can go into the parameters of this entryexit location, go to the location tab and check the option "ensure walkable area". This will tell PD to make the activity location walkable even if it's outside the heightlayer boundaries or overlapping an obstacle.

When you did this, you'll find out that PD still generates errors. You might also notice that the network lines (make them visible with the button Display > Medial Axis) look different in the upper side of the model. Actually the activity locations are not connected to the walkable space in the height layer. This is because you added an additional height layer, but the activity locations are in height layer 2. You can check this by clicking the layers button in the model layout and then change the visibility of the layers by clicking the buttons with the eye on it.

To move your platform 2 activity locations into the heightlayer nr. 2, you can do the following:
- Activate the height layer nr 2 in the layer overview to the right of the model layout.
- Select the to-be-moved activity location.
- Go into Selection > click the button Move into active height layer.

When you add extra activity locations to your model always make sure to first selec/activate the right height layer in the layer overview.

Once I did those changes the model was running fine.

Success! Marlies
ie_1989
Posts: 58
Joined: Saturday 21 November, 2015 - 06:50

Re: Queuing in PD

Post by ie_1989 »

Thanks a lot Marlies, you mentioned tiny but critical points :)
Post Reply