LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
getProbSys.m
1function probSys = getProbSys(self)
2% PROBSYS = GETPROBSYS()
3if GlobalConstants.DummyMode
4 probSys = NaN;
5 return
6end
7TranSysState = self.sampleSys;
8TSS = cell2mat([TranSysState.t,TranSysState.state(:)']);
9TSS(:,1)=[TSS(1,1);diff(TSS(:,1))];
10sn = self.getStruct;
11% fill-in for FCFS states
12for isf=1:size(TranSysState.state,2)
13 if size(sn.state{isf},1)>1
14 error('There are multiple station states, choose an initial state as a parameter to getProb.');
15 end
16 sn.state{isf} = [zeros(1,size(TranSysState.state{isf},2)-size(sn.state{isf},2)),sn.state{isf}];
17end
18state = cell2mat(sn.state');
19rows = findrows(TSS(:,2:end), state);
20if ~isempty(rows)
21 probSys = sum(TSS(rows,1))/sum(TSS(:,1));
22else
23 line_warning(mfilename,'The state was not seen during the simulation.\n');
24 probSys = 0;
25end
26end