LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
pollingGet.m
1function [pos, swk, ctr] = pollingGet(pinfo, space_var, srvclass)
2% [POS, SWK, CTR] = POLLINGGET(PINFO, SPACE_VAR, SRVCLASS)
3%
4% Read the polling controller out of the local-variable columns of a single
5% state row. SRVCLASS is the class currently in the service facility, or 0 when
6% the facility is empty.
7%
8% The columns that State.pollingInfo elides are reconstructed here, so that
9% callers always see a complete controller:
10% pos when not materialized, every switchover is immediate, so the server is
11% either serving (and then it stands at the buffer of the job in
12% service) or parked (and then its position is unobservable: from a park
13% with only immediate switchovers the walk reaches any buffer in zero
14% time, so all positions have identical dynamics and 1 is canonical).
15% swk when not materialized, no switchover takes time, so the server is
16% never inside one.
17% ctr when not materialized the discipline is EXHAUSTIVE, which bounds a
18% visit by the buffer draining rather than by a budget.
19
20% Copyright (c) 2012-2026, Imperial College London
21% All rights reserved.
22
23if pinfo.ipos > 0
24 pos = space_var(1, pinfo.ipos);
25elseif srvclass > 0
26 pos = srvclass;
27else
28 pos = 1;
29end
30if pinfo.iswk > 0
31 swk = space_var(1, pinfo.iswk);
32else
33 swk = 0;
34end
35if pinfo.ictr > 0
36 ctr = space_var(1, pinfo.ictr);
37else
38 ctr = 0;
39end
40end
Definition Station.m:245