No BSD License  

Highlights from
Queueing Systems Toolbox

from Queueing Systems Toolbox by Bill Higley
These deal with an M/M/c queue and a finite source queue

machine(lambda,mu,m,cw,cs)
%machine(lambda,mu,m,cw,cs)
%   This function finds the optimal number of servers
%   to be hired in order to maximize profit, or equivilently,
%   minimize the cost of repairmen and revenue lost to down machines.

function out = machine(lambda,mu,m,cw,cs)

cont = 1;
c = 1;
costlast = inf;
while cont == 1
    ld = fsqfindld(lambda,mu,c,m);
    costnow = cw*ld + cs*c;
    if costnow < costlast
        costlast = costnow;
        c = c + 1;
    end
    if costnow > costlast
        cont = 0;
    end
end

out = c;
    

Contact us at files@mathworks.com