Speedmaxl
Speedmaxl

Reputation: 41

Make pedestrians divert to another queue if QueueTime Exceeds a preselected Value

Edited Version: I'm actually modelling an airport check-in terminal. It works fine so far, but additional I'm still trying to implement a function, that allows my pedestrians not to enter the service-queue if the queue time exceeds a preselected value (e.g. already 15 Passengers in the queue) and therefore walks to some kind of backup Service that opens during this busy times.

Here is my approach:

  1. Variable QueueSize returns permanently the actual Number of Passengers in the Queue.
  2. Every time a ped enters the pedservice block CheckInEco, the function waitingTime() starts:
QueueSize = CheckInEco.size(); 
if (QueueSize > 15) CheckInEco.cancel(ped) 

So, as soon as there are more than 15 Agents in the queue, number 16 should bypass and move to an alternate ServiceBlock, which I would connect to the ccl Port of the CheckInEco Service. But when building the model, I get this message: ped cannot be resolved to a variable?

According to Anylogic Help, it should be possible to use this cancel - call, but I'm not really experienced with it.. Maybe, someone can help me out?

function waitingTime

screenshot Main

PedService CheckInEco

Upvotes: 0

Views: 120

Answers (1)

Jaco-Ben Vosloo
Jaco-Ben Vosloo

Reputation: 3940

You can simply use a select output block to prevent pedestrians from going into the service block if there are more than 16 pedestrians already in.

enter image description here

Your original question had to do with waiting time, you should follow the exact same approach. But with waiting time it gets more complicated since you don't want to take the average waiting time from the start of the simulation.... so you need to decide if you want to take the last 10 minutes, 1 hour etc and do you want to include the current waiting time of agents in the queue. Since this is the the questions anymore I am not going to add it here, perhaps ask a new question if this is still the case.

Upvotes: 1

Related Questions