Queueing Network Details
This simulator can simulate open queueing network that consists of a finite number of G/G/s/K stations to provide service.
External customers may enter the network via each station.
A customer that completes the service at one station may be routed to another to receive further service or leave the network subject to probability.
The notations and more details
- The network has stations.
- Station has
identical servers, each of which has the service rate , for
.
All the stations follow the first-in-first-out (FIFO) discipline.
And there is only one queue for each station.
- The arrival rate of external customers to station is
, for .
There exists some for which .
- A customer that completes the service at station
is routed to station
with probability
and leaves the network with probability
,
for .
There exists some for which .
Moreover, it is allowed that a customer finishing service is routed to the same station (re-enter), i.e., can be nonzero.
In this case, the customer will join the end of the queue (if any) of this station while the first customer in queue (if any) move into the vacated server simultaneously.
- Station has capacity , i.e. the maximum number of customers allowed in the station, including those waiting in queue and those in the servers,
for .
The capacity can be finite or infinite.
Customers’ behavior when a station is at full capacity
- If an external customer arrives at a station when it is full, then the customer will not enter the network and is lost permanently.
- If an internal customer who finishes the service at station and is routed to station finds that station is full, then the customer is blocked at station and occupy the original server until there is a place at station .
The blocked customers, either at the same station or at different stations, are unblocked with a FIFO discipline.
This blocking mechanism is known as blocking-after-service (BAS).
About deadlock
For queueing network with closed loop and finite capacity, deadlock phenomenon may occur.
In this simulator, when deadlock occurs, it is solved by swapping instantaneously.
Besides, when a customer re-enters a station, he has higher priority than those blocked in other stations.
Code Details
The codes were written in MATLAB R2015a.
They (except for the third-party functions mentioned below) can be freely redistributed and used under the terms of the BSD 3-Clause License.
Download the entire package
with an example in it.
Structure
Before calling the simulator, we first need to find all the closed loop in the network (in order to handle the potential deadlock).
It is achieved by a third-party function “find_elem_circuits.m” (author: Chris Maes gist.github.com/cmaes/1260153).
Moreover, the function “find_elem_circuits.m” relies on a function “components.m”,
which is a function in the graph package MatlabBGL (author: David Gleich dgleich.github.io/matlab-bgl).
The identified closed loops are then passed into the simulator together with all other network parameters.
- Input: QueuePra - queueing network parameters
- total station number
- arrival rate and distribution (needs to modify “inter_arrival_time.m”) to each station
- server number at each station
- service rate and distribution (needs to modify “service_time.m”) of a server in each station
- transition (routing) probability matrix
- capacity (wating space + server number) of each station
- the list of all loops of the network (where the deadlock may happen) identified by “find_elem_circuits.m”
- Inputs: SimPra - simulation parameters
- time length for one replication
- warm up length to let the queue be steady
- number of simulation replication
- random seed
- Outputs:
- stationary distribution for each station
- averaged number of customers in each station1 & the whole system, and the variance of the AVERAGED number
- averaged number of customers waiting in each station queue & the whole system2, and the variance of the AVERAGED number
- averaged sojourn time3 in each station & the whole system (waiting + serving), and the variance of the AVERAGED number
- averaged waiting time3,4 in each station queue & the whole system, and the variance of the AVERAGED number
Notes:
1
It includes the customers waiting in the queue + customers under service + customers who have finished service but still occupy the server because the destination station is full.
2
Customers who have finished service but still occupy the server because the destination station is full are not included.
3
When calculating the averaged sojourn time and waiting time,
only consider the customers ever enter the system and leave the system before simulation terminates,
i.e., the rejected customers are not counted; the customers who are still in the system when simulation terminates are not counted.
Besides, if a customer never enters station 1, he will not be counted when calculating averaged sojourn time and waiting time for station 1.
(It is not difficult to modify the code to count all arrivals.)
If a customer enters station 1 more than once, he is still regarded as one customer.
4
When a customer finishes service but still occupies the server because the destination station is full, such time period is not considered as waiting time.
The waiting time only means the time a customer spends in the queue.
» Go back to the homepage
© simopt.github.io
Last Update: 2018-05-17