djordon / queueing-tool

Simulator for queueing networks written in Python
http://queueing-tool.readthedocs.org/
MIT License
64 stars 9 forks source link

Queues with abandonment #98

Open djordon opened 1 year ago

djordon commented 1 year ago

Hi Daniel,

Sorry for the late response.

I am trying to simulate the settings in this paper. Here they assume the customer patience time has a general distribution, where customers would not wait longer than a random variable she draws from the assumed distribution. In other words (quote from the paper):

Associated with each arriving caller there is a generally distributed patience time τ with a common distribution G. An arriving customer encounters an offered waiting time V, defined as the time that this customer would have to wait given that her or his patience is infinite. If the offered wait exceeds the customer’s patience time, the call is then abandoned, otherwise, the customer awaits service. In both cases, the actual waiting time W is equal to min(V, τ).

To answer your questions I would thus say:

  1. What information needs to be retained when an agent abandons the queue? The wait time of the customer needs to be retained I think.
  2. What factors influence abandonment, and which ones should be built in? Do long lines influence abandonment? What about wait time? I would say doing it as the paper suggests is pretty intuitive. Here we have an invisible queue (like a call center) and the customer abandons when her wait time in the queue surpasses her patience.
  3. Where do the agents go in a network after a queue is abandoned? Can they return? Let's assume a non-orbiting queue, where the customer abandons and does not return.

Please do let me know if I can be of any help with improving the package to take care of this issues.

Best, Saman Lagzi Assistant Professor | Operations & Decision Sciences Wilfrid Laurier University | Lazaridis School of Business & Economics


Originally posted by @saman-lagzi in https://github.com/djordon/queueing-tool/issues/95#issuecomment-1648764697

djordon commented 1 year ago

Sorry for the delay @saman-lagzi, but here is a rough outline of what I think should happen.

  1. The QueueServer needs to know when each agent left the queue-server. Without abandonment, this always happens after service, but with abandonment it can happen while in the queue.
  2. When an agent leaves the queue, you need to note that it was an abandonment. All data collected by the QueueServer assumes no abandonment, so we'll need to modify the data we collect.

There are a few ways to accomplish this, but none of them are particularly easy/elegant since you'll need to create a new class and overwrite a few functions in QueueServer. This is because an arriving caller/agent (I'll use agent from here on) cannot know up-front how long it needs to wait before it receives service. This is because, most of the time, the random numbers necessary to know your waiting time have not been generated by the time the agent needs them in order to know its departure time. You could get around this by estimating the wait time, but you still need to implement functions that estimate the waiting time and handle abandonment.

Here is one approach to do this:

  1. Create an AbandonAgent that subclasses Agent. This agent caries a distribution function for its patience.
    • The implementation of the AbandonAgent.queue_action functions needs to note it's arrival time and patience when it arrives to the queue. Or maybe we create a separate function for this step, but either way the agent should note the arrival time.
  2. Create an AbandonQueue that subclasses QueueServer. You should probably re-implement
    • QueueServer.next_event to handle abandonment upon arrival or service start. If it's upon arrival, you'll need to tell the AbandonAgent an estimate of the service start time and then have it abandon given its patience. If it's at service start time then you can just compare the current time with the agent's (internal) abandonment time and proceed accordingly. You'll also want to store some abandonment time in the AbandonQueue.data list.
    • QueueServer.fetch_data to accommodate the extra data we want to know about.

The hard part is understanding QueueServer.next_event and how it should be modified. Let me know if what I said helps/makes sense. I know it's probably quite a bit to digest, hopefully I was moderately clear.

saman-lagzi commented 1 year ago

Hi Daniel.

Thank you so much for your help. This is going to be incredibly helpful.

Best, Saman Lagzi Assistant Professor | Operations & Decision Sciences Wilfrid Laurier University | Lazaridis School of Business & Economics


From: Daniel Jordon @.> Sent: July 26, 2023 11:43 AM To: djordon/queueing-tool @.> Cc: Saman Lagzi @.>; Mention @.> Subject: Re: [djordon/queueing-tool] Queues with abandonment (Issue #98)

Sorry for the delay, but here is a rough outline of what I think should happen.

  1. The QueueServer needs to know when each agent left the queue-server. Without abandonment, this always happens after service, but with abandonment it can happen while in the queue.
  2. When an agent leaves the queue, you need to note that it was an abandonment. All data collected by the QueueServer assumes no abandonment, so we'll need to modify the data we collect.

There are a few ways to accomplish this, but none of them are particularly easy/elegant since you'll need to create a new class and overwrite a few functions in QueueServer. This is because an arriving caller/agent (I'll use agent from here on) cannot know up-front how long it needs to wait before it receives service. This is because, most of the time, the random numbers necessary to know your waiting time have not been generated by the time the agent needs them in order to know its departure time. You could get around this by estimating the wait time, but you still need to implement functions that estimate the waiting time and handle abandonment.

Here is one approach to do this:

  1. Create an AbandonAgent that subclasses Agent. This agent caries a distribution function for its patience.
    • The implementation of the AbandonAgent.queue_action functions needs to note it's arrival time and patience when it arrives to the queue. Or maybe we create a separate function for this step, but either way the agent should note the arrival time.
  2. Create an AbandonQueue that subclasses QueueServer. You should probably re-implement
    • QueueServer.next_event to handle abandonment upon arrival or service start. If it's upon arrival, you'll need to tell the AbandonAgent an estimate of the service start time and then have it abandon given its patience. If it's at service start time then you can just compare the current time with the agent's (internal) abandonment time and proceed accordingly. You'll also want to store some abandonment time in the AbandonQueue.data list.
    • QueueServer.fetch_data to accommodate the extra data we want to know about.

The hard part is understanding QueueServer.next_event and how it should be modified. Let me know if what I said helps/makes sense. I know it's probably quite a bit to digest, hopefully I was moderately clear.

— Reply to this email directly, view it on GitHubhttps://github.com/djordon/queueing-tool/issues/98#issuecomment-1652076195, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A3AOH7YKMIPQ2GCZSH6775DXSE3JNANCNFSM6AAAAAA2YWNG4I. You are receiving this because you were mentioned.Message ID: @.***>

galenseilis commented 12 months ago

Is abandonment in this context the same thing as reneging? Reneging is where an agent leaves the wait list before getting served. Sometimes this is more specifically interpreted as leaving the wait list before getting served because they have waited too long.

djordon commented 12 months ago

Yeah, I understand them to be the same thing.

galenseilis commented 12 months ago

Yeah, I understand them to be the same thing.

Okay, thank you! :)