1function ProbSys = getProbSys(self)
2% PROBSYS = GETPROBSYS()
3% Joint steady-state probability of
the current system state, estimated as
the
4% time-weighted fraction of
the system-wide simulated trajectory in that joint
5% state. Fully JSON-mediated (via sampleSys()). Mirrors Python-native getProbSys().
7if GlobalConstants.DummyMode
12sysResult = self.sampleSys(0);
13if isempty(sysResult) || ~isstruct(sysResult) || isempty(sysResult.t)
19states = sysResult.state;
21if nt < 2 || isempty(states)
26sn = self.model.getStruct;
27nstateful = numel(states);
28targets = cell(1, nstateful);
30 if iscell(sn.state) && numel(sn.state) >= isf && ~isempty(sn.state{isf})
31 targets{isf} = sn.state{isf}(:).
';
33 targets{isf} = zeros(1, size(states{isf}, 2));
48 L = min(numel(targets{isf}), size(states{isf}, 2));
49 if ~all(abs(states{isf}(ti, 1:L) - targets{isf}(1:L)) < 1e-10)
55 timeInState = timeInState + dt;
58ProbSys = timeInState / total;