1function space = pollingSpace(sn, ind, space)
2% SPACE = POLLINGSPACE(SN, IND, SPACE)
4% Append
the polling controller columns to
the rows of SPACE, which must hold
5%
the [buffer, server, routing-variable] layout of a polling station. Rows are
6% expanded into one row per controller configuration
the discipline can
7% occupy, and rows
for which no configuration exists are dropped.
9% Enumerating
the controller per row rather than as a blind cartesian product
10%
is what keeps
the state space tight and
the chain irreducible: pos
is pinned
11% to
the class in service, a switchover excludes a busy service facility, and a
12% park excludes a non-empty station. A cartesian product would instead admit
13% states such as
"serving buffer 1 while a class-2 job occupies the server",
14% which no transition can reach or leave in a way consistent with
the marginals.
16% Copyright (c) 2012-2026, Imperial College London
19pinfo = State.pollingInfo(sn, ind);
20if isempty(pinfo) || isempty(space)
25ist = sn.nodeToStation(ind);
28 if isempty(sn.proc{ist}{r})
31 K(r) = length(sn.proc{ist}{r}{1});
35nsrvcols = R + (1:sum(K));
38for row=1:size(space,1)
39 nbuf = space(row, nbufcols);
40 srv = space(row, nsrvcols);
41 % class occupying
the single service facility, 0 when it
is empty
44 if sum(srv((sum(K(1:r-1))+1):sum(K(1:r)))) > 0
49 blocks = State.pollingProject(pinfo, State.pollingBlocks(pinfo, srvclass, nbuf, R));
50 for b=1:size(blocks,1)
51 out(end+1,:) = [space(row,:), blocks(b,:)]; %
#ok<AGROW>
55 space = zeros(0, size(space,2) + pinfo.width);