Simulation of M/M/1 queue with code (not simulink)
Show older comments
Hello, I have an exercise from my uni in matlab and its about M/M/1 queue.
"A small branch of a bank has only one fund for servicing all transactions. It has been observed that the duration of the service is an exponential random variable with a mean value of 6 minutes, i. e. m= 10 clients per hour.
Customer arrivals are a Poisson procedure with mean arrivals lamda = 3 customers per hour.
The service protocol is FCFS, i.e. whoever the first is served first. We assume that there is unlimited queue waiting space.
We want to make the matlab code the above scenario.
We want to count:
- average arrival rate L (clients per hour)
- average service time Ws
- average number of customers in queue
Your program will deal with three types of event: arrivals, departures and termination of the simulation.
For each event type you will need different functions.
The basic functions of the program are:
- initialization: zero status variables, zero status of statistical counters, initialization of the events list (first arrival and first departure).
- timing: indication of the next event (arrival or departure), information of the timer
- arrival: information of status variables and counters, creating an eventual arrival.
- departure:update status variables and counters, creation of a next departure.
- endsimulation: end the loop of the simulation.
I want some serius help here cause i am new in matlab and i dont know so well to solve all of those.
Answers (0)
Categories
Find more on Verification, Validation, and Test in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!