Simulating Bus Stop Work: Queuing Model Considerations

In summary, the queuing model for simulating a bus stop work would need to take into account both the normally distributed service times and Poisson arrivals of passengers. The difference between bus arrival time and schedule may be normally distributed and the queue length distribution when the bus arrives should also be considered. A possible approach could be to use a gamma function to model the distribution of passengers in a given bus arrival interval. However, this model may not fit into the standard queuing models as it involves different concepts for service time.
  • #1
Mark J.
81
0
Hi

At the bus stop -normally distributed service times and Poisson arrivals of passengers.
To which queuing model should I be oriented for making a simulation of bus stop work?
Regards
 
Physics news on Phys.org
  • #2
Mark J. said:
At the bus stop -normally distributed service times and Poisson arrivals of passengers.
To which queuing model should I be oriented for making a simulation of bus stop work?
Regards
I assume you're asking for a standard name, similar to M/M/1, M/D/1, M/G/1.
But the service implied in those models is not the same as for bus arrivals. A bus will service (usually) the entire queue in one go. The difference between bus arrival time and schedule may be normally distributed (but typically not: a few a little early, with a long tail of late ones), but that's not the same as 'service time' in standard queueing models.
I suggest you consider a scheduled bus time, the distribution of the actual bus arrival, what that means for the time since the preceding bus, and the consequent queue length distribution when the bus arrives.
 
  • #3
haruspex said:
I assume you're asking for a standard name, similar to M/M/1, M/D/1, M/G/1.
But the service implied in those models is not the same as for bus arrivals. A bus will service (usually) the entire queue in one go. The difference between bus arrival time and schedule may be normally distributed (but typically not: a few a little early, with a long tail of late ones), but that's not the same as 'service time' in standard queueing models.
I suggest you consider a scheduled bus time, the distribution of the actual bus arrival, what that means for the time since the preceding bus, and the consequent queue length distribution when the bus arrives.

Thank you Haruspex that's exactly what I mean.
By schedule bus should be every 4 minutes but actual bus arrival is normally distributed.
That's why I cannot find myself in a single model for example M/G/1
What do you suggest?
Thank you
 
  • #4
I suggest what I suggested before:
- take time t0 as the scheduled time for a bus arrival;
- obtain a distribution for the time between the preceding bus and the next bus. This is awkward since in principle (according to the assumption they're independent and Gaussian) they could be in reversed order. For now, hope that doesn't matter.
- based on that interval length distribution, obtain a distribution for the size of the queue when the next bus arrives.
 
  • #5
Thx.

Interval length distribution -normal distribution.

That's where the pain begins to chose model :)

regards
 
  • #6
Let the individual bus arrival time discrepancy from schedule be N(0,σ). The interval distribution will be N(T,σ√2). But for the next step, you want the absolute value of the interval time, so this folds the distribution left of 0 over to the right. (If that gets too nasty we may be able to ignore it without going too far wrong in reasonable situations.)
The probability of k user arrivals in time t is (λt)ke-λt/k!. So the prob of k in a given bus arrival interval is
[itex]\int^{+\infty}_{-\infty}\frac{(λ|t|)^ke^{-λ|t|}}{k!}.dF(t) = \frac{1}{2\sigma\sqrt{\pi}}\int^{0}_{-\infty}\frac{(-λt)^ke^{λt}}{k!}.e^{-\frac{(t-T)^2}{4\sigma^2}}.dt + \frac{1}{2\sigma\sqrt{\pi}}\int^{+\infty}_{0}\frac{(λt)^ke^{-λt}}{k!}.e^{-\frac{(t-T)^2}{4\sigma^2}}.dt[/itex]
Right now, that's as far I can get. Will think about it more.
OTOH, I'm not sure if this is heading where you want to go. What is the actual problem to be solved?
 
  • #7
Thank you very much for your answer.
Actually I am working on a model of bus stop work.
I have studied real data and I have concluded for a normal distribution in bus service times
and Poisson distribution for passenger arrivals.
Making assumptions about independence just to keep as simple as possible I want to arrive in a simulation so I can make the difference between bus working by scheduled times (every 4 minutes) and bus working for real (with small delays) just as you prescribed on previous messages.
Thank you for helping.
Regards
 
  • #8
OK, so let's say σ << T, so we can overlook the fact that the bus interarrival time can go negative. The prob of k people in a given bus arrival interval is then
[itex]\frac{1}{2\sigma\sqrt{\pi}}\int^{+\infty}_{-\infty}\frac{(λt)^ke^{-λt}}{k!}.e^{-\frac{(t-T)^2}{4\sigma^2}}.dt[/itex]
By suitable change of variable, the integral can be massaged into the form
[itex]I = \int^{+\infty}_{-\infty}(t+c)^ke^{-t^2}.dt[/itex]
I think the best that can be done with that is to expand the binomial term as a sum.
[itex]I_r = \left(\stackrel{k}{r}\right)\int^{+\infty}_{-\infty}t^rc^{k-r}e^{-t^2}.dt[/itex]
Because of the range of integration, the terms with odd powers of t will vanish. A further change of variable, w = t2, then produces
[itex]I_{2r} = \frac{1}{2}\left(\stackrel{k}{2r}\right) \int_{-\infty}^{+\infty}w^{r-\frac{1}{2}}c^{k-2r}e^{-w}.dw[/itex]
which produces a gamma function on r.
Does this help?
 
  • #9
Thank you very much.
You are being so helpful and it is so nice for you thinking as quite possible bus headway normally distributed because everybody seems to think only about Poisson arrivals and forget about bus headway as a service time (composition of several processes not just arrival).
Your argument of gamma function on r seems OK but maybe I am missing something on the way it brings to a known queuing model (smth like M/G/...) because I can see it as the model of arrival but combination with normal service time (for client group service)seems to miss in normal queueing literature.
Every book has M/M/... but hey where is my kind of model :(
Am I wrong on my way of trying to view on the model?
Best regards
 
  • #10
Mark J. said:
maybe I am missing something on the way it brings to a known queuing model (smth like M/G/...) because I can see it as the model of arrival but combination with normal service time (for client group service)seems to miss in normal queueing literature.
Every book has M/M/... but hey where is my kind of model :(
Am I wrong on my way of trying to view on the model?
As I said in my first reply, 'service time' in your scenario is a different concept from that in the standard models.
In all the standard models:
- a server serves one customer each service time;
- the service time random variable is measured from customer arrival at front of queue, and has no memory of prior state of the server.
In yours:
- the server (a bus) serves the entire queue in one hit;
- service time is driven by a schedule independently of customers.
An opportunity for you to contribute to the nomenclature? M/S/1 (S for schedule) perhaps?
 
  • #11
haruspex said:
- the service time random variable is measured from customer arrival at front of queue,
I meant to add that in consequence the service time can never be negative, so never Gaussian.
 
  • #12
Hey Mark J.

Are you familiar with the Bayesian way of probability/statistical inference? If not I recommend you check it out since you can experiment with a lot of different priors for your rate used in the Poisson, and this area has a lot of results that can help derive situations or find them numerically (even if they are super-super complicated).
 
  • #13
haruspex said:
I meant to add that in consequence the service time can never be negative, so never Gaussian.

My measurement in real system (times of bus arrivals) are all positive of course but anyway after several tests normal distribution seems to fit better regarding inter arrivals (time difference between 2 sequent buses) .

So suppose service time is all about this Gaussian distribution or I kind of misunderstand ?

Regards
 
  • #14
chiro said:
Hey Mark J.

Are you familiar with the Bayesian way of probability/statistical inference? If not I recommend you check it out since you can experiment with a lot of different priors for your rate used in the Poisson, and this area has a lot of results that can help derive situations or find them numerically (even if they are super-super complicated).

Chiro thank you for your answer.

Perhaps you can direct me to any case similar to mine where is used Bayesian way of probability/statistical inference mentioned by you?
It would really help
Regards
 
  • #15
Mark J. said:
My measurement in real system (times of bus arrivals) are all positive of course but anyway after several tests normal distribution seems to fit better regarding inter arrivals (time difference between 2 sequent buses) .

So suppose service time is all about this Gaussian distribution or I kind of misunderstand ?
I didn't understand that last sentence.
Let me repeat: in the meaning of 'service time' in the standard models, Gaussian makes no sense; in the rather different meaning of service time in your scenario, it does make sense. I'm merely trying to explain why (a) you won't find a standard model that does what you want, and (b) why some you discuss this with might tell you your Gaussian model is wrong.
I'm quite prepared to believe Gaussian works for your bus interarrival times. It really can be negative, because buses could get out of order. Where that case gets tricky is that the customers don't care about bus order - they'll take the first that comes along. But as long as this is rare it shouldn't have much effect on the results.
 
  • #16
Yes what you say fits perfectly my case.
Thank you for making it more clear to me.
Regards
 
  • #17
Mark J. said:
Chiro thank you for your answer.

Perhaps you can direct me to any case similar to mine where is used Bayesian way of probability/statistical inference mentioned by you?
It would really help
Regards

This is an actual post describing looking at a simulation in R:

http://tolstoy.newcastle.edu.au/R/e2/help/07/01/9219.html

Another search response from google:

https://www.google.com.au/url?sa=t&...sg=AFQjCNHgg00JebYIuPho-S9jmu6gAjjQCw&cad=rja

Also note that as haruspex pointed out, you can't have negative rates. What you should do is instead use something like a chi-square or a gamma prior and then do inference on this.

Alternatively another thing you could do is restrict your PDF to the positive real line and double the value of the PDF since the PDF of a Normal is symmetric, this will maintain the behaviour of the PDF and still keep the PDF valid (i.e. integrates to 1).

If you want this option, then you should use something like R and use a simulation to sample from your modified 'normal' (I suggest you look into the Gamma priors though) and then generate a posterior given this prior (again look at first link for an idea of how to do this in R).
 
  • #18
chiro said:
This is an actual post describing looking at a simulation in R:

http://tolstoy.newcastle.edu.au/R/e2/help/07/01/9219.html

Another search response from google:

https://www.google.com.au/url?sa=t&...sg=AFQjCNHgg00JebYIuPho-S9jmu6gAjjQCw&cad=rja

Also note that as haruspex pointed out, you can't have negative rates. What you should do is instead use something like a chi-square or a gamma prior and then do inference on this.

Alternatively another thing you could do is restrict your PDF to the positive real line and double the value of the PDF since the PDF of a Normal is symmetric, this will maintain the behaviour of the PDF and still keep the PDF valid (i.e. integrates to 1).

If you want this option, then you should use something like R and use a simulation to sample from your modified 'normal' (I suggest you look into the Gamma priors though) and then generate a posterior given this prior (again look at first link for an idea of how to do this in R).

Thank you for the fast response.
Seems interesting I will have a look at it.
Regards
 
  • #19
haruspex said:
As I said in my first reply, 'service time' in your scenario is a different concept from that in the standard models.
In all the standard models:
- a server serves one customer each service time;
- the service time random variable is measured from customer arrival at front of queue, and has no memory of prior state of the server.
In yours:
- the server (a bus) serves the entire queue in one hit;
- service time is driven by a schedule independently of customers.
An opportunity for you to contribute to the nomenclature? M/S/1 (S for schedule) perhaps?

Hi Haruspex,

If M/S/1 (S for schedule) where S is every 4 minutes we got still that problem of group service for the clients which gets really nasty in terms of comparing models.
It should be some methods of comparing these 2 models the real one and the scheduled one but in my readings still not finding some approach to that.That is what you mean by contribute to the nomenclature if I get it right.
Regards
 
  • #20
Mark J. said:
If M/S/1 (S for schedule) where S is every 4 minutes we got still that problem of group service for the clients which gets really nasty in terms of comparing models.
It should be some methods of comparing these 2 models the real one and the scheduled one
Sorry, you've lost me. Which of these two models (real/scheduled) is the one we've been discussing (regular arrival with Gaussian error), and what is the other model?
I was (half seriously) proposing M/S/n as (new) terminology for a class of models that includes yours. In general, it wouldn't have to be Gaussian error, but it would involve an underlying regular service which operates independently of the queue. Could elaborate it to M/SG/ (scheduled with Gaussian error), M/SD/ (scheduled with no error, i.e. deterministic), etc.
I didn't think through the '/1' part though. Could have this mean the maximum number in the queue serviced by one service event, so yours would be, say, M/SG/∞.
 
  • #21
-Real model is (Poisson arrival of clients/normal distributed arrival of buses)
-Scheduled model is (Poisson arrival of clients/regular arrival of buses every 4 minutes)
About number of servers this is quite another question but I need it in the most simplified way.
These are the models to compare in order to make an estimation about what needs to improve in order to approximate the regular with estimated.

Regards
 

1. What is a queuing model?

A queuing model is a mathematical model used to study waiting lines or queues. It is used to analyze and predict the behavior of systems involving waiting lines, such as bus stops, call centers, and supermarkets.

2. Why is queuing modeling important in simulating bus stops?

Queuing modeling is important in simulating bus stops because it allows us to understand and optimize the flow of passengers at the bus stop. By using queuing models, we can determine the average waiting time, queue length, and resource utilization at the bus stop, which can help improve the overall efficiency of the bus system.

3. What are the key considerations in queuing modeling for bus stops?

Some key considerations in queuing modeling for bus stops include the arrival rate and distribution of passengers, the service rate of buses, the number of servers (buses), and the size and layout of the bus stop. Other factors such as passenger behavior, weather, and traffic conditions may also need to be taken into account.

4. What are the different types of queuing models used for simulating bus stops?

The most commonly used queuing models for simulating bus stops are the M/M/c model, the M/M/1 model, and the M/G/c model. The M/M/c model assumes a Poisson arrival process, exponential service times, and c servers. The M/M/1 model assumes a single server, while the M/G/c model allows for a general service time distribution.

5. How can queuing models be validated for simulating bus stops?

Queuing models can be validated by comparing the model outputs (e.g. average waiting time, queue length) to real-world data collected at the bus stop. If the model accurately reflects the observed behavior, it can be considered valid. Sensitivity analysis can also be performed to test the robustness of the model to changes in input parameters.

Similar threads

  • Set Theory, Logic, Probability, Statistics
Replies
6
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
1
Views
2K
  • Set Theory, Logic, Probability, Statistics
Replies
3
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
2
Views
1K
Replies
8
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
4
Views
2K
  • Set Theory, Logic, Probability, Statistics
Replies
18
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
1
Views
3K
  • Set Theory, Logic, Probability, Statistics
Replies
30
Views
2K
  • Special and General Relativity
Replies
9
Views
1K
Back
Top