1function Q_DT_SMK_ParsePara(C, C_name, processType)
2% Q_DT_SMK_Service_ParsePara checks the validity of the input cell C as a
3% representation of a Discrete-Time marked Semi-Markov process.
5% If the SMK
is a service process
6% C{k}=[Ck_1 Ck_2...Ck_tmax(k)],
for k=1...K, where the entry (j,j
') of
7% the mxm matrix Dk_i holds the probability that the service time of
8% a type-k customer takes i time slots (i=1:tmax(k)), while the
9% underlying phase changes from j to j'
11% If the SMK
is an arrival process
12% C{k}=[Ck_1 Ck_2...Ck_tmax(k)],
for k=1...K, where the entry (j,j
') of
13% the mxm matrix Ck_i, holds the probabilities of having a type k
14% arrival, with an interarrival time of i time slots (i=1:tmax(k)),
15% while the underlying phase changes from j to j'
17% processType: equals 1 if the SM[K] process
is an arrival process and 0
18% if it represents a service process
22 error(
'MATLAB:Q_DT_SMK_ParsePara:InvalidInput',...
23 'The type of the SM[K] process (arrival or service) has to be specified');
30 error(
'MATLAB:Q_DT_SMK_ParsePara:InvalidInput',...
31 'Matrix %s_%d has to be numeric', C_name, i);
38 error(
'MATLAB:Q_DT_SMK_ParsePara:InvalidInput',...
39 '%s_%d has to be a real matrix',C_name,i);
45 if (mod( size(C{i},2),size(C{i},1)) ~= 0)
46 error(
'MATLAB:Q_DT_SMK_ParsePara:InvalidInput',...
47 '%s_%d is not a set of square matrices',C_name,i);
52 if (size(C{i},1) ~= size(C{i+1},1))
53 error(
'MATLAB:Q_DT_SMK_ParsePara:InvalidInput',...
54 'The matrices %s_%d and %s_d do not have the same number of rows',C_name,i,C_name,i+1);
60 if (min(min(C{i})) < -10^(-14))
61 error(
'MATLAB:Q_DT_SMK_ParsePara:InvalidInput',...
62 'The matrix %s_%d contains negative data',C_name,i);
72 tmax(i) = size(C{i},2)/m;
73 Csum{i} = reshape(sum(reshape(C{i}, m*m, tmax(i)), 2), m, m);
74 if (max(sum(Csum{i},2)) > 1+10^(-14))||(min(sum(Csum{i},2)) < 1-10^(-14))
75 error(
'MATLAB:Q_DT_SMK_ParsePara:InvalidInput',...
76 'The matrix %s_%d(1)+%s_%d(2)...+%s_%d(%d) has to be stochastic', C_name,i,C_name,i,C_name,i,tmax(i));
79 % check that transition matrices Csum are equal
for all types
81 if (max(max(abs(Csum{i+1}-Csum{i}))) > 10^(-14))
82 error(
'MATLAB:Q_DT_SMK_ParsePara:InvalidInput',...
83 'The matrices %s_%d(1)+%s_%d(2)...+%s_%d(%d) and %s_%d(1)+%s_%d(2)...+%s_%d(%d)',...
84 'have to be identical ', C_name,i,C_name,i,C_name,i,tmax(i),C_name,i+1,C_name,i+1,C_name,i+1,tmax(i+1));
88 %check stochasticity of the sum of the arrival matrices
92 Csum = Csum + sum(C{i}, 2);
94 if (max(Csum) > 1+10^(-14))||(min(Csum) < 1-10^(-14))
95 error(
'MATLAB:Q_DT_SMK_ParsePara:InvalidInput',...
96 'The transition matrix of the embedded Markov chain of the semi-Markov process has to be stochastic');