function Analyzer;

global Demands muA muS;
global Num devicenum
global Devices refusednum capacity
global curtime queuetime worktime TimeCount muA muS systemtime
global queueamount workamount sysamount queuenum time
global sysusage avgwaittime avglivetime avgqueueamount avgsysamount

sysusage = worktime/(devicenum*curtime);

sum = 0;
for i=2:length(Demands)
    sum = sum + Demands(2,i);
end;

muA = sum/(length(Demands)-1);

sum = 0;
for i=1:length(Demands)
    sum = sum + Demands(3,i);
end;


muS = sum/length(Demands);


avgqueueamount = queuetime/curtime;

avgwaittime = avgqueueamount*muA;

sysamount = queueamount + workamount;

avglivetime = avgwaittime+muS;

avgsysamount = avglivetime/muA;

