0

I know that the inter arrival times in a Possion process is exponentially distributed. So I assume when I use the matlab command as below, the outputs follow the definition.

services= poissrnd(20,1,4)  %like for 4 time units. t=1,2,3,4
%output is like 18    19    14    19

But I want a traffic generation where each traffic service also has a service duration which is exponentially distributed. I believe this is different from the exp inter-arrival time aspect. So, how can I generate a duration for each service that is exp distributed so that I can depart it from the system once that duration is over. Do I need separate exp distribution? How can i connect the two then?

For e.g."Poisson process with an avg. arrival rate of λ requests per time-unit, and the lifetime of each request following negative exponential distribution with an average of 1/μ time units. So that the traffic load is λ/μ"

  • Not sure I'm understanding your question. A Poisson process has exponentially distributed times between occurrences of its events, so a Poisson arrival process has exponentially distributed inter-arrival times. An exponential service process, however, is not a Poisson process because the delays yielding an end service event are relative to the begin service event, which is only equal to the prior end service when there are people waiting for service. If there's no queue then the begin service is the arrival time, not the prior end service time. – pjs Oct 29 '21 at 16:52
  • @pjs I couldn't properly understand your answer from 'delays yielding and...' part. But I will try to rephrase my doubt. What I was saying is that I want my arrivals to follow a Poisson process, whcih I get from the command shown. W.r.t the e.g. statement I gave, say I have 18 services for t=1 (as in the question). Then I want each of the 18 services to have a certain duration/lifetime. And such lifetimes are exponentially distributed with a certain average value. I want this duration because I would like to consider service expiration so that I delete/depart/prioritize them. – knowledge_seeker Oct 29 '21 at 17:20
  • @pjs I understand the concept on paper but when I am coding I am only able to generate a Possion distributed numbers and I consider them as equivalent to saying as number of arrivals. But I am unable to code the duration for which each service will stay. I was departing randomly to show the effect of the service termination but now I want to depart using times that are exp distributed. The e.g. I gave at the end is from a research paper. – knowledge_seeker Oct 29 '21 at 17:23
  • What I was trying to say in my first comment was that all Poisson processes have exponential inter-event times, but not all exponential delays mean you have a Poisson process. An end service event occurs *t* time units after a begin service event - where *t* has an exponential distribution - but a begin service event doesn't always correspond to the last end service so service completion events are not a Poisson process. – pjs Oct 29 '21 at 17:59
  • What's stopping you from generating [exponentials](https://www.mathworks.com/help/stats/exprnd.html) directly? – pjs Oct 29 '21 at 18:07
  • @pjs E.g. poissrnd(20) gives 18. And exprnd(35) gives 2.7900. So I am like should I consider like each of the 18 services stay for 2.79 time units. And in my loop I keep checking after every t iteration increment. Do you think it is wrong for me to disintegrate the number 18 and consider as 18 poisson distributed services? Since 18 in itself is just a single number from Poisson distbn.... – knowledge_seeker Oct 29 '21 at 18:08
  • @pjs That is what I finally thought to do but I was confused as I am unable to comprehend how can I combine two things. I.e. I write one command for Poisson (as shown in ques.) and then I wrote another command for exponential distribution. But then how can I combine and use the results to make the meaning I said before – knowledge_seeker Oct 29 '21 at 18:18
  • I still don't understand what you're actually asking. You've given one line of code for generating Poissons, so we know that's not your problem. By specifying exponential distributions for both the arrival and service processes you're describing an M/M system in [Kendall's notation](https://en.wikipedia.org/wiki/Kendall's_notation). Is it an M/M/1? An M/M/k? An M/M/∞? And most importantly, what are you trying to do with it? – pjs Oct 29 '21 at 18:21
  • @pjs I need this concept to do resource allocation in optical networks. I have my own algorithm to do the allocation. So I need traffic generation to test my algorithm. For that I read in peer papers that they use the Poisson process in the way I mentioned in Italics in the main question. – knowledge_seeker Oct 29 '21 at 19:31
  • @pjs To simulate a real life traffic scenario, I need to have departures of the services. That is why even though the arrivals are Poisson distributed, I say that each service has a duration. Periodically I need to empty/depart such expired services as I need not consider them for resource allocation or depart them by freeing up the resources I allocated to them. By resources, I mean in terms of variables I use such as bandwidth. – knowledge_seeker Oct 29 '21 at 19:31
  • @pjs I guess now I understand what you are saying. In that case, it should be M/M/1 in my case. So, maybe I should look on how to generate M/M/1 process. I guess this sums it up. Isn't it? – knowledge_seeker Oct 29 '21 at 19:34
  • Okay, good to know it's an M/M/1 process. Now the question becomes: what do you want to know about it, i.e., what are your performance measures? Determining how long traffic is held up in the queue, or the times at which departures occur, is quite straightforward. Tracking the size of the queue over time requires different bookkeeping. – pjs Oct 29 '21 at 20:03
  • @pjs Honestly, I never viewed this as M/M/1 process. I just thought I would need few numbers that would be representative of number of services arriving. When this exponential serive duration came into picture all this confusion started. Hence, I am not quite sure when you say 'performance measures'. . But I can say that maybe I need to know the 'times at which departures occur'. Assuming that I periodically check these times to decide what to do with a service. I say this as none of the related research papers mention M/M/1 process other than just saying the stmt in italics in the question. – knowledge_seeker Oct 29 '21 at 20:43
  • @pjs For e.g. one paper just says "Poisson process following a uniform traffic distribution, with the average arrival rate and service duration being 20 and 35 time units, respectively" – knowledge_seeker Oct 29 '21 at 20:47
  • I suspect you misread the paper, since an arrival **rate** of 20 and service **duration** of 35 would be extremely unstable. Average duration is the inverse of the rate, so what you're describing is on average items arrive every 1/20 of a time unit and they require 35 time units to serve - they're arriving 700 times faster than they can be served, and your queue is very rapidly going to go to infinity. Are you quite certain both weren't rates? – pjs Oct 29 '21 at 21:26
  • I had only pasted the statement from the paper. Like λ=20 and 1/μ=35. But after your answers, I searched using M/M/1 name in my topic area and I found a paper that says this and I think this make sense. What do you say? "The simulation is based on the M/M/1 birth-death model, in which new connection requests arrive according to a Poisson process at an average rate of λ (λ = 0.1, 0.2, ..., 1), while their holding time conforms to a negative exponential distribution. The average holding time is 730 time units in the simulation." I am really grateful to your willingness to help. – knowledge_seeker Oct 29 '21 at 21:35
  • I think those numbers make no sense for an M/M/1 queueing system. At this point I think you have a modeling problem, not a programming problem. You need to figure out and clearly express 1) what are the inputs to this system, 2) **what is the logic which transforms those inputs into results**, and 3) what are the outputs/results you want. – pjs Oct 29 '21 at 21:48
  • Ok, I will see what I can do. Thanks. These are the kind of numbers I see in the papers related to my resource allocation problem. In fact, almost all of them don't even say M/M/1. Maybe it really isn't. But then, with the word exp service duration only M/M/1 makes sense. When i say programming problem, I see it as pondering on how can i do departures based on the times. But here it seems the question is both how to have the times (modelling) and then how to use the times to show departures. Departure so that resources are freed up for incoming ones. – knowledge_seeker Oct 29 '21 at 21:57
  • @pjs Thanks a lot for the detailed discussions. I appreciate your patience. – knowledge_seeker Oct 29 '21 at 21:57

0 Answers0