On this page you'll find my assignments for Caput Stochastic Optimalisation

This is assignment F of Caput Stochastic Optimalization

by Joeri van Hoeve (BWI'96)



The long-run probability of call blocking in an M/M/s/s system

This is a calculator, which calculates the long-run probability of call blocking by using backward recursion. You must fill in the arrival rate of calls per minute (default = 1) and the expected service time (default = 5) and also the number of agents/lines in the system (default = 5) and an epsilon (default = 0.0000000001). With the calculate button you'll get the probability. 
Arrivals: per minute
Service time: minutes
Number of agents/lines: 
Epsilon: 
Probability of long term call blocking: ,

back to topics



 

What's the model M/M/s/s ?

The long-run probability of call blocking is the same (with PASTA) as the average expected costs on the long run (the costs c(x) are 1 for being in state s and 0 for not being in state s). So we'll include these costs in our model.
Then the average expected costs can be seen as the  fraction of time in state s on the long run and (with PASTA) this is the same as the fraction of blocked calls.

We can make this conclusion only for constant expected transition times T_x = tau_x. In this system the tau_x are not constant.  We can add dummy transitions and so taking an constant tau  by assuming:

Then the backward recursion is as follows: with stopcriterium: Then :

      V_n+1(x) - V_n(x)/tau = g   for all x

 and g = lim (V_t(x)/t  for all x = expected stationary costs = long-run probability of call blocking.

back to topics


Code  in javascript

var lambda;
var mu;
var s;
var tau;
var epsilon;
var Averschil = new Array();
var Vn = new Array();
var Vnmin = new Array();

function bereken(){

lambda = Number(document.form1.lambda.value);
mu = 1/Number(document.form1.ES.value);
s = Number(document.form1.s.value);
epsilon = Number(document.form1.e.value);
tau = 1/(lambda +(s*mu));

document.form1.Pvl.value=0;

for(var i = 0;i < s+1; i++) {
    Averschil[i] = 0;
    Vn[i] = 0;
    Vnmin[i] = 0;
}
bepaal_vn();

document.form1.Pvl.value = (Vn[s]-Vnmin[s])/tau;
}

function voldaan( ) {

var min;
var max;

Averschil[0]=(Vn[0]-Vnmin[0]);
max= Averschil[0];
min= Averschil[0];

for(var i=1 ; i <= s;i++){
    Averschil[i] = Vn[i] - Vnmin[i];
        if (Averschil[i] >max)
            max = Averschil[i];
        if (Averschil[i]  < min)
            min = Averschil[i];
};

if (max-min < epsilon)
    return 1;
else
    return 0;
}

function bepaal_vn() {
do {

for(var i = 0;i < s+1; i++) {
    Vnmin[i] = Vn[i];
    Vn[i] = 0;
};

for(var i = 0;i < s+1; i++) {
    if (i == 0)
        Vn[i] = (lambda*tau)*1*Vnmin[1] + (1-(lambda*tau))*Vnmin[0];
    if (i >0 & i< s) if (i > 0 & i< s)
    Vn[i] = (((lambda +i*mu)*tau) *((lambda/(lambda+i*mu))*Vnmin[i+1] +(((i*mu)/(i*mu+lambda)) * Vnmin[i-1]))) + (1-((lambda + i*mu)*tau))*Vnmin[i];
    if (i == s)
    Vn[i] = tau + (s*mu)*tau*1*Vnmin[s-1] + (1-((s*mu)*tau))*Vnmin[s];
};

} while (!voldaan());

}

back to topics