Poisson process: exponential inter arrival time vs exponential holding time

18 次查看(过去 30 天)
Inter arrival times in a Possion process is exponentially distributed. So I assume when I use the below command the ouputs follow that definition.
services= poissrnd(20,1,4) %like for 4 time units. t=1,2,3,4
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 λ/μ"

回答(1 个)

Hornett
Hornett 2024-9-19
To simulate a system where arrivals follow a Poisson process and service durations are exponentially distributed, you'll use MATLAB's exprnd function for both inter-arrival times and service durations, not poissrnd. Here's a brief guide:
Generating Inter-Arrival Times
For an average arrival rate λ:
lambda = 5; % Example average arrival rate
numServices = 4; % Number of services
interArrivalTimes = exprnd(1/lambda, 1, numServices);
Generating Service Durations
For an average service rate μ:
mu = 10; % Example service rate
serviceDurations = exprnd(1/mu, 1, numServices);
Connecting Both
Calculate arrival times by summing the inter-arrival times:
arrivalTimes = cumsum(interArrivalTimes);
This way, you have interArrivalTimes for when services enter the system and serviceDurations for how long each service lasts, modeling a system with traffic load characterized by λ/μ.
Follwing documentation might help you in your implementation
Hope this helps!

产品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by