1function U = getEntryServiceMatrix(self)
2% Matrix that returns the entry servt after multiplication with residt
3% of entries and activities
4eshift = self.lqn.eshift;
5U = sparse(self.lqn.nidx + self.lqn.ncalls, self.lqn.nidx + self.lqn.ncalls);
6for e = 1:self.lqn.nentries
8 U = getEntryServiceMatrixRecursion(self.lqn, eidx, eidx, U);
13function U = getEntryServiceMatrixRecursion(lqn, aidx, eidx, U)
14% auxiliary function to getServiceMatrix
15nextaidxs = find(lqn.graph(aidx,:));
16G = double(full(lqn.graph)>0); % connection matrix between LQN elements
17for nextaidx = nextaidxs
20 % in the activity graph, the following
if is entered only
21 % by an edge that
is the
return from a LOOP activity
22 if (lqn.graph(aidx,nextaidx) ~= lqn.dag(aidx,nextaidx))
25 if ~(lqn.parent(aidx) == lqn.parent(nextaidx))
26 %%
if the successor activity
is a call
27 for cidx = lqn.callsof{aidx}
28 switch lqn.calltype(cidx)
30 U(eidx,lqn.nidx+cidx) = 1; % mean number of calls already factored in
32 % nop - doesn
't contribute to respt
36 % here we have processed all calls, let us do the activities now
37 %% if the successor activity is not a call
38 if (lqn.parent(aidx) == lqn.parent(nextaidx))
42 U(eidx,nextaidx) = U(eidx,nextaidx) + G(aidx,nextaidx); % self-loops not included as already accounted in visits
43 %% now recursively build the rest of the routing matrix graph
44 U = getEntryServiceMatrixRecursion(lqn, nextaidx, eidx, U);