LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
ctmc_ssg.m
1function [stateSpace,stateSpaceAggr,stateSpaceHashed,nodeStateSpace,sn] = ctmc_ssg(sn,options)
2
3[stateSpace,stateSpaceHashed,qnc] = State.spaceGenerator(sn, options.cutoff, options);
4nodeStateSpace = qnc.space;
5sn.space = nodeStateSpace;
6
7% if options.verbose
8% line_printf('\nCTMC state space size: %d states. ',size(stateSpace,1));
9% end
10if ~isfield(options, 'hide_immediate')
11 options.hide_immediate = true;
12end
13
14nstateful = sn.nstateful;
15nclasses = sn.nclasses;
16sync = sn.sync;
17A = length(sync);
18stateSpaceAggr = zeros(size(stateSpaceHashed));
19
20% for all synchronizations
21for a=1:A
22 stateCell = cell(nstateful,1);
23 for s=1:size(stateSpaceHashed,1)
24 state = stateSpaceHashed(s,:);
25 % update state cell array and SSq
26 for ind = 1:sn.nnodes
27 if sn.isstateful(ind)
28 isf = sn.nodeToStateful(ind);
29 stateCell{isf} = sn.space{isf}(state(isf),:);
30 if sn.isstation(ind)
31 ist = sn.nodeToStation(ind);
32 [~,nir] = State.toMarginal(sn,ind,stateCell{isf});
33
34 stateSpaceAggr(s,((ist-1)*nclasses+1):ist*nclasses) = nir;
35 end
36 end
37 end
38 end
39end
40end