LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
getProbAggr.m
1function Pnir = getProbAggr(self, ist)
2% PNIR = GETPROBAGGR(IST)
3%
4% Probability of a SPECIFIC per-class job distribution at a station.
5% Returns P(n1 jobs of class 1, n2 jobs of class 2, ...) for current state.
6%
7% Compare with getProbMarg: returns total queue-length distribution,
8% i.e., P(n total jobs) summed over all class combinations.
9%
10% Input:
11% ist - Station index or node object
12%
13% Output:
14% Pnir - Scalar probability in [0,1]
15
16if GlobalConstants.DummyMode
17 Pnir = NaN;
18 return
19end
20
21if ~isnumeric(ist) % station object
22 ist = ist.index;
23end
24
25sn = self.getStruct;
26if nargin<2 %~exist('ist','var')
27 line_error(mfilename,'getProb requires to pass a parameter the station of interest.');
28end
29if ist > sn.nstations
30 line_error(mfilename,'Station number exceeds the number of stations in the model.');
31end
32if ~isfield(self.options,'keep')
33 self.options.keep = false;
34end
35T0 = tic;
36sn.state = sn.state;
37
38if isempty(self.result) || ~isfield(self.result,'Prob') || ~isfield(self.result.Prob,'marginal')
39 Pnir = solver_ctmc_margaggr(sn, self.options);
40 self.result.('solver') = getName(self);
41 self.result.Prob.marginal = Pnir;
42else
43 Pnir = self.result.Prob.marginal;
44end
45runtime = toc(T0);
46self.result.runtime = runtime;
47Pnir = Pnir(ist);
48end