1% Finds the response times along each path leading out of start until
2% endNode taking into account
class swithces
3function ri = findPathsCS(sn,
P, curNode, endNode, curClass, toMerge, QN, TN, currentTime, fjclassmap, fjforkmap, nonfjmodel)
5 % Add the current response time of the parallel branch to the list, but subtract the synchronisation time
6 qLen = sum(QN(sn.nodeToStation(curNode), toMerge));
7 tput = sum(TN(sn.nodeToStation(curNode), toMerge));
8 ri = currentTime - qLen / tput;
12 nfjsn = nonfjmodel.getStruct(
false);
13 orignodes = length(nfjsn.rtorig{1,1});
14 for transition=find(
P((curClass-1)*orignodes+curNode, :))
16 nextClass = floor((transition - 1) / orignodes) + 1;
17 nextNode = transition-(nextClass-1) * orignodes; %
new class
18 curMerge(1) = nextClass;
21 if ~isnan(sn.nodeToStation(nextNode))
22 qLen = sum(QN(sn.nodeToStation(nextNode), curMerge));
23 tput = sum(TN(sn.nodeToStation(nextNode), curMerge));
25 if sn.nodetype(nextNode) == NodeType.Fork
26 joinIdx = find(sn.fj(nextNode,:));
27 s = find(fjforkmap == nextNode & fjclassmap == nextClass);
28 paths = ModelAdapter.findPathsCS(sn,
P, nextNode, joinIdx, nextClass, [curMerge,s], QN, TN, 0, fjclassmap, fjforkmap, nonfjmodel);
31 parallel_branches = length(paths);
32 for pow=0:(parallel_branches - 1)
33 current_sum = sum(1./sum(nchoosek(lambdai, pow + 1),2));
34 d0 = d0 + (-1)^pow * current_sum;
37 nonfjmodel.nodes{joinIdx}.setService(nonfjmodel.classes{cls}, Exp.fitMean((d0 - mean(paths))));
39 ri = [ri, ModelAdapter.findPathsCS(sn,
P, joinIdx, endNode, nextClass, curMerge, QN, TN, currentTime + d0, fjclassmap, fjforkmap, nonfjmodel)];
41 ri = [ri, ModelAdapter.findPathsCS(sn,
P, nextNode, endNode, nextClass, curMerge, QN, TN, currentTime + qLen/tput, fjclassmap, fjforkmap, nonfjmodel)];