LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
getProbSysAggr.m
1function ProbSysAggr = getProbSysAggr(self)
2% PROBSYSSTATEAGGR = GETPROBSYSSTATEAGGR()
3
4if GlobalConstants.DummyMode
5 ProbSysAggr = NaN;
6 return
7end
8
9TranSysStateAggr = self.sampleSysAggr;
10TSS = cell2mat([TranSysStateAggr.t,TranSysStateAggr.state(:)']);
11TSS(:,1)=[TSS(1,1);diff(TSS(:,1))];
12sn = self.getStruct;
13state = sn.state;
14nir = zeros(sn.nstateful,sn.nclasses);
15for isf=1:sn.nstateful
16 ind = sn.statefulToNode(isf);
17 if size(state{isf},1) > 1
18 line_warning(mfilename,'Some states at node %d will be ignored. Please assign the node with a specific state.\n', ind);
19 end
20 [~,nir(isf,:)] = State.toMarginal(sn, ind, state{isf}(1,:));
21end
22nir = nir';
23rows = findrows(TSS(:,2:end), nir(:)');
24if ~isempty(rows)
25 ProbSysAggr = sum(TSS(rows,1))/sum(TSS(:,1));
26else
27 line_warning(mfilename,'The state was not seen during the simulation.\n');
28 ProbSysAggr = 0;
29end
30end