# Getting Started

After downloading the MAP QN Toolbox from the Download section, add the directory
containing the scripts to the MATLAB path. From now on you will be able
to call the MAP QN Toolbox function from the MATLAB interface.

Let's see some simple examples of MAP queueing networks. We will
first start from special cases without burstiness (Example 1 and
Example 2) and then we will focus on MAP queueing networks with bursty
service times.

The queueing network is composed by two tandem queues with
exponential service times. The mean service time at the first queue is
3s, the mean service time at the second queue is 4s; the total
population is 5 jobs. We want to compute the mean throughput of the
model measured at the output of queue 1. This is done by first defining
the routing matrix P which describes the topology

`>> P=[0,1;1,0]`

followed by the specification of
the service processes `>> MEAN1=3; MEAN2=4;`

>> Q1=map_exponential(MEAN1);

>> Q2=map_exponential(MEAN2);

and of the total population`>> N=5;`

At this point, to compute the mean
throughput of the network it is sufficient to type`>> mapqn_ezsolve({Q1;Q2},N,P)`

ans =
0.2320

To compute the exact queue-length and utilization values
the right invocation is```
>> [XN,QN,UN]=mapqn_ezsolve({Q1;Q2},N,P);
```

Now the utilization and queue-lengths, e.g., of queue 2,
are respectively`>> UTIL2=sum(UN(2,:))`

UTIL2 =

0.9278

>> QLEN2=sum(QN(2,:))

QLEN2 =

3.2991

Further details on the output values of the
mapqn_ezsolve function can be obtained by typing`>> help mapqn_ezsolve`

Example 2 (MATLAB, Queueing Network with High Service Variability/GI)

Consider the same network of Example 1 and assume that we wish to add a third queue with hyper-exponential service times (mean 7, squared coefficient of variation 25, stage selection probability p=0.99) and placed in parallel to the second queue. A job goes from queue 1 to queue 2 with probability 70%, to queue 3 with probability 20%, otherwise with probability 10% it immediately loops back in queue 1.

This system is specificied as follows.

`>> P=[0.1,0.7,0.2;1,0,0;1,0,0];`

>> MEAN1=3; MEAN2=4; MEAN3=7; SCV3=25; p=0.99;

>> Q1=map_exponential(MEAN1);

>> Q2=map_exponential(MEAN2);

>> Q3=map_hyperexp(MEAN3,SCV3,p);

>> N=5;

>> [XN,QN,UN]=mapqn_ezsolve({Q1;Q2;Q3},N,P);

>> XN

XN = 0.2546

Example 3
(MATLAB, MAP
Queueing Networks)Suppose to modify queue 3 in the Example 2 with a two-phase MAP process having skewness 10 and autocorrelation function that at lag-1 is 0.35. We have:

```
>> MEAN1=3; MEAN2=4; MEAN3=7; SCV3=25; SKEW3=10; ACF3=0.35;
>> Q1=map_exponential(MEAN1);
>> Q2=map_exponential(MEAN2);
>> Q3=map_mmpp2(MEAN3,SCV3,SKEW3,ACF3);
>> N=5;
>> [XN,QN,UN]=mapqn_ezsolve({Q1;Q2;Q3},N,P);
>> XN
XN = >> P=[0.1,0.7,0.2;1,0,0;1,0,0];
0.2318
```