Simulation Optmization


 

Queueing Network Simulator

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

  1. The network has stations.
  2. 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.
  3. The arrival rate of external customers to station is , for . There exists some for which .
  4. 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.
  5. 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

  1. If an external customer arrives at a station when it is full, then the customer will not enter the network and is lost permanently.
  2. 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.

Inputs and outputs

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