LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
getProbAggr.m
1function Pr = getProbAggr(self, node, state_a)
2% PR = GETPROBAGGR(NODE, STATE_A)
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 given 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% node - Node object
12% state_a - Per-class job counts, e.g., [2,1] = 2 class-1, 1 class-2
13%
14% Output:
15% Pr - Scalar probability in [0,1] (estimated via simulation)
16if GlobalConstants.DummyMode
17 Pr = NaN;
18 return
19end
20sn = self.getStruct;
21if nargin<3 %~exist('state_a','var')
22 state_a = sn.state{sn.nodeToStation(node.index)};
23end
24stationStateAggr = self.sampleAggr(node);
25rows = findrows(stationStateAggr.state, state_a);
26t = stationStateAggr.t;
27dt = [diff(t);0];
28Pr = sum(dt(rows))/sum(dt);
29end