close all;
clear all;

mu=0.5;
lambda=0.25;

%CASE(a)
s=2;
m=6;
n=2;

[av,longTermPi]=nma_HW_12_3(lambda,mu,m,n,s);
fprintf('CASE(a)\n');
fprintf('mu=[%f], lambda=[%f], m=%d, n=%d, s=%d\n',mu,lambda,m,n,s);

fprintf('Average number of machines not operational [%f]\n',av);
fprintf('long Term stationary distribution vector\n');
longTermPi


%CASE(b)
s=3;
m=6;
n=2;

[av,longTermPi]=nma_HW_12_3(lambda,mu,m,n,s);
fprintf('CASE(b)\n');
fprintf('mu=[%f], lambda=[%f], m=%d, n=%d, s=%d\n',mu,lambda,m,n,s);

fprintf('Average number of machines not operational [%f]\n',av);
fprintf('long Term stationary distribution vector\n');
longTermPi


%
%
%
m=6;
n=2;

s=1:n+m;
averages=zeros(length(s),1);

for i=1:length(s)
    [averages(i),longTermPi]=nma_HW_12_3(lambda,mu,m,n,s(i));
end

plot(s,averages);
title('Showing effect of increasing number of servers on average');
xlabel('S, number of servers');
ylabel('Average number of machines not operational');
ylim([0,max(averages)]);