1function Pnir = getProb(self, node, state)
2% PNIR = GETPROB(NODE, STATE) Returns state probabilities at equilibrium
4% @brief Returns state probabilities
for a given node, including phase information
6% This method computes the steady-state marginal state probability distribution
7%
for jobs at a specified station. Unlike getProb_aggr(),
this method returns
8% full state-space probabilities including phase information from service distributions.
10% @param self SolverCTMC instance
11% @param node Queue or node object (or node index as integer)
12% @param state (optional) State specification as vector. If provided, returns
13% probability of
this specific state. If omitted, returns probabilities
14%
for all states at the node.
16% @
return Pnir Matrix of state probabilities. If state parameter was provided,
17% returns a scalar probability value. Otherwise returns a matrix where
18% rows represent different states and columns represent job
classes.
19% For phase-type distributions, includes phase dimension in state space.
21% @note Only supported by CTMC and SSA solvers due to their state-space formulation.
22% For aggregated probabilities (without phase info), use getProb_aggr() instead.
24% @see getProb_aggr - Returns probabilities aggregated over phases
25% @see getProbSys - Returns joint system state probabilities
29% solver = SolverCTMC(model);
30% queue1 = model.
nodes{1};
32% % Get all state probabilities
for queue1
33% prob_matrix = solver.getProb(queue1);
35% % Get probability
for specific state [2 jobs of
class 0, 1 job of class 1]
36% queue1.setState([2, 1]);
37% prob_specific = solver.getProb(queue1);
40if GlobalConstants.DummyMode
45if nargin<2 %~exist(
'node',
'var')
46 line_error(mfilename,'getProb requires to pass a parameter the station of interest.');
48if ~isfield(self.options,'keep')
49 self.options.keep = false;
54if nargin>=3 %exist('state','var')
55 sn.state{node} = state;
58for isf=1:length(sn.state)
59 isf_param = sn.nodeToStateful(ind);
61 sn.state{isf} = sn.state{isf}*0 -1;
64Pnir = solver_ctmc_marg(sn, self.options);
65self.result.(
'solver') = getName(self);
66self.result.Prob.marginal = Pnir;
68self.result.runtime = runtime;