LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
ctmc_ssg.m
1function [stateSpace,stateSpaceAggr,stateSpaceHashed,nodeStateSpace,sn] = ctmc_ssg(sn,options)
2
3if isfield(sn,'fjsync') && ~isempty(sn.fjsync)
4 % fork firings break per-chain population conservation, so the
5 % population-lattice enumeration cannot generate FJ state spaces
6 line_error(mfilename,'Fork-join models require reachability-based state space generation (options.config.state_space_gen=''reachable'').');
7end
8
9[stateSpace,stateSpaceHashed,qnc] = State.spaceGenerator(sn, options.cutoff, options);
10nodeStateSpace = qnc.space;
11sn.space = nodeStateSpace;
12
13% if options.verbose
14% line_printf('\nCTMC state space size: %d states. ',size(stateSpace,1));
15% end
16if ~isfield(options, 'hide_immediate')
17 options.hide_immediate = true;
18end
19
20nstateful = sn.nstateful;
21nclasses = sn.nclasses;
22sync = sn.sync;
23A = length(sync);
24stateSpaceAggr = zeros(size(stateSpaceHashed));
25
26% for all synchronizations
27for a=1:A
28 stateCell = cell(nstateful,1);
29 for s=1:size(stateSpaceHashed,1)
30 state = stateSpaceHashed(s,:);
31 % update state cell array and SSq
32 for ind = 1:sn.nnodes
33 if sn.isstateful(ind)
34 isf = sn.nodeToStateful(ind);
35 stateCell{isf} = sn.space{isf}(state(isf),:);
36 if sn.isstation(ind)
37 ist = sn.nodeToStation(ind);
38 [~,nir] = State.toMarginal(sn,ind,stateCell{isf});
39
40 stateSpaceAggr(s,((ist-1)*nclasses+1):ist*nclasses) = nir;
41 end
42 end
43 end
44 end
45end
46end
Definition Station.m:245