# copyright Barry L. Nelson and Michael R. Taaffe 2000
with(linalg):
PhPhInfMCNSojourn := proc(A, lambda, R, B, mu, K, Pr, arrivalT)
#
# this procedure returns the mean, variance, and cdf for a virtual
# arrival at time arrivalT to a [Ph_t/Ph_t/Infinity]^K network for
# each of R different arrival processes
#
# initial conditions for the queue are empty and idle
#
# this version is designed to work with Maple 6/7/8
#
# last update 7/28/00 08/20/00 10/15/03
#
# Inputs:
# A = Markov chain transition matrix for the arrival process
# [vector of matrices of dimension R]
# lambda = arrival rate vector
# [vector of vectors of dimension R]
# R = number of distinct Ph arrival processes
# B = Markov chain transition matrix for the service process
# [vector of matrices of dimension K]
# mu = service rate vector
# [vector of vectors of dimension K]
# Pr = Markov routing probabilities
# arrivalT = arrival time of virtual arrival
local r, temp, sojourns;
if R = 1 then
RETURN(PhPhInfNetSojourn(A, lambda, B, mu, K, Pr, arrivalT));
else
sojourns := vector(R);
temp := PhPhInfNetSojourn(A[1], lambda[1], B, mu, K, Pr[1], arrivalT);
sojourns[1] := temp;
for r from 2 to R do
temp := PhPhInfNetSojourn(A[r], lambda[r], B, mu, K, Pr[r], arrivalT);
sojourns[r] := temp;
od;
RETURN(sojourns);
fi;
end;