![]() |
LINE Solver (C++)
Templated C++ port of the LINE queueing solver
|
#include <line/lang/lqn/lqn_struct.h>
Public Member Functions | |
| double | fanout_at (std::size_t i, std::size_t j) const |
| fan-out from caller task i to callee task j; 0 when undeclared. | |
| std::size_t | host_of (std::size_t idx) const |
| Index of the host of the element, for a task or anything owned by one. | |
Public Attributes | |
| std::size_t | nidx = 0 |
| std::size_t | nhosts = 0 |
| std::size_t | ntasks = 0 |
| std::size_t | nentries = 0 |
| std::size_t | nacts = 0 |
| std::size_t | ncalls = 0 |
| std::size_t | hshift = 0 |
| std::size_t | tshift = 0 |
| std::size_t | eshift = 0 |
| std::size_t | ashift = 0 |
| std::size_t | cshift = 0 |
| std::vector< std::string > | names |
| (nidx+1) declared name | |
| std::vector< std::string > | hashnames |
| (nidx+1) name prefixed by kind: P:/T:/R:/E:/A: | |
| std::vector< LqnElement > | type |
| (nidx+1) | |
| std::vector< std::size_t > | parent |
| (nidx+1) host of a task, task of an entry/activity | |
| std::vector< SchedStrategy > | sched |
| (tshift+ntasks+1) | |
| std::vector< double > | mult |
| (tshift+ntasks+1) declared multiplicity, may be Inf | |
| std::vector< double > | maxmult |
| (tshift+ntasks+1) sustainable multiplicity | |
| std::vector< double > | repl |
| (tshift+ntasks+1) replication | |
| std::vector< std::vector< T > > | lldscaling |
| Queue-dependent service rates declared on a layer server (a host or a task), by element index, empty where absent. | |
| std::vector< CdScaling< T > > | cdscaling |
| (tshift+ntasks+1) | |
| std::vector< std::vector< T > > | cdscalingpeak |
| (tshift+ntasks+1) | |
| std::vector< CdScaling< T > > | jdscaling |
| (tshift+ntasks+1) | |
| std::vector< std::vector< T > > | jdscalingpeak |
| (tshift+ntasks+1) | |
| std::vector< ServerPools< T > > | pools |
| (tshift+ntasks+1) | |
| std::map< std::pair< std::size_t, std::size_t >, double > | fanout |
| Fan-out and fan-in, keyed by task element index, absent = 0. | |
| std::map< std::pair< std::size_t, std::size_t >, double > | fanin |
| std::vector< bool > | isref |
| (tshift+ntasks+1) | |
| std::vector< bool > | iscache |
| (tshift+ntasks+1) | |
| std::vector< bool > | hassetup |
| (tshift+ntasks+1) | |
| std::vector< std::size_t > | nitems |
| Cache tasks and item entries. | |
| std::vector< std::vector< int > > | itemcap |
| (tshift+ntasks+1) | |
| std::vector< ReplacementStrategy > | replacestrat |
| (tshift+ntasks+1) | |
| std::vector< std::vector< T > > | itemproc |
| (nidx+1) popularity pmf | |
| std::vector< Distrib< T > > | setuptime |
| Setup tasks: the server powers down when idle and pays to restart. | |
| std::vector< Distrib< T > > | delayofftime |
| std::vector< Distrib< T > > | hostdem |
| (nidx+1) host demand per activity (Immediate elsewhere) | |
| std::vector< Distrib< T > > | think |
| (nidx+1) task think time | |
| std::vector< Distrib< T > > | actthink |
| (nidx+1) activity think time | |
| std::vector< bool > | has_arrival |
| (nidx+1) entry with an open arrival | |
| std::vector< Distrib< T > > | arrival |
| (nidx+1) open arrival process of an entry | |
| std::vector< std::vector< std::size_t > > | tasksof |
| (nhosts+1) | |
| std::vector< std::vector< std::size_t > > | entriesof |
| (tshift+ntasks+1) | |
| std::vector< std::vector< std::size_t > > | actsof |
| (ashift+1) by task and by entry | |
| std::vector< std::vector< std::size_t > > | callsof |
| (nidx+1) call indices issued by an activity | |
| std::vector< std::size_t > | callpair_src |
| (ncalls+1) calling activity (entry for FWD) | |
| std::vector< std::size_t > | callpair_dst |
| (ncalls+1) called entry | |
| std::vector< CallType > | calltype |
| (ncalls+1) | |
| std::vector< T > | callproc_mean |
| (ncalls+1) mean number of calls | |
| std::vector< std::string > | callnames |
| (ncalls+1) | |
| std::vector< std::string > | callhashnames |
| (ncalls+1) | |
| SparseGraph< T > | graph |
| element call/precedence graph, edge weights are branch shares | |
| SparseGraph< T > | dag |
| graph with entry-task edges reversed and loop back-edges removed | |
| SparseGraph< T > | taskgraph |
| task-to-task calls | |
| BoolGraph | iscaller |
| BoolGraph | issynccaller |
| BoolGraph | isasynccaller |
| std::vector< Matrix< T > > | lincon_A |
| Admission constraint A n <= b on the layer station of a host or task. | |
| std::vector< std::vector< T > > | lincon_b |
| std::vector< std::vector< LqnPrecedence< T > > > | precedences |
| Activity precedences of each task, as DECLARED, indexed by the task's absolute index. | |
| std::vector< LqnCallGroup > | callgroups |
| Synchronous calls DISPATCHED AS A GROUP, lsn.callgroups. | |
| std::vector< PrecedenceType > | actpretype |
| (nidx+1) | |
| std::vector< PrecedenceType > | actposttype |
| (nidx+1) | |
| std::vector< std::size_t > | actquorum |
| (nidx+1) AND-join quorum, on the join target | |
| std::vector< int > | actphase |
| (nacts+1) phase of each activity, 1-based by act | |
Definition at line 208 of file lqn_struct.h.
|
inline |
fan-out from caller task i to callee task j; 0 when undeclared.
Definition at line 259 of file lqn_struct.h.
|
inline |
Index of the host of the element, for a task or anything owned by one.
Definition at line 370 of file lqn_struct.h.
| std::vector<int> line::lqn::LqnStruct< T >::actphase |
(nacts+1) phase of each activity, 1-based by act
Definition at line 367 of file lqn_struct.h.
| std::vector<PrecedenceType> line::lqn::LqnStruct< T >::actposttype |
(nidx+1)
Definition at line 365 of file lqn_struct.h.
| std::vector<PrecedenceType> line::lqn::LqnStruct< T >::actpretype |
(nidx+1)
Definition at line 364 of file lqn_struct.h.
| std::vector<std::size_t> line::lqn::LqnStruct< T >::actquorum |
(nidx+1) AND-join quorum, on the join target
Definition at line 366 of file lqn_struct.h.
| std::vector<std::vector<std::size_t> > line::lqn::LqnStruct< T >::actsof |
(ashift+1) by task and by entry
Definition at line 305 of file lqn_struct.h.
| std::vector<Distrib<T> > line::lqn::LqnStruct< T >::actthink |
(nidx+1) activity think time
Definition at line 299 of file lqn_struct.h.
| std::vector<Distrib<T> > line::lqn::LqnStruct< T >::arrival |
(nidx+1) open arrival process of an entry
Definition at line 301 of file lqn_struct.h.
| std::size_t line::lqn::LqnStruct< T >::ashift = 0 |
Definition at line 210 of file lqn_struct.h.
| std::vector<LqnCallGroup> line::lqn::LqnStruct< T >::callgroups |
Synchronous calls DISPATCHED AS A GROUP, lsn.callgroups.
synchCallRoundRobin / synchCallJSQ issue one call per invocation whose destination cycles over, or is chosen among, several target entries. The members are ordinary SYNC calls of mean total/n and are already in callpair; what this adds is that they are ONE dispatch decision rather than n independent Bernoulli draws, which is the whole point – the mean call rate is the same and the variance is not.
Representable only under the squashed layering, since the targets must share a submodel for a dispatch among them to mean anything, and only under a layer solver that resolves the strategy from the state.
Definition at line 362 of file lqn_struct.h.
| std::vector<std::string> line::lqn::LqnStruct< T >::callhashnames |
(ncalls+1)
Definition at line 313 of file lqn_struct.h.
| std::vector<std::string> line::lqn::LqnStruct< T >::callnames |
(ncalls+1)
Definition at line 312 of file lqn_struct.h.
| std::vector<std::size_t> line::lqn::LqnStruct< T >::callpair_dst |
(ncalls+1) called entry
Definition at line 309 of file lqn_struct.h.
| std::vector<std::size_t> line::lqn::LqnStruct< T >::callpair_src |
(ncalls+1) calling activity (entry for FWD)
Definition at line 308 of file lqn_struct.h.
| std::vector<T> line::lqn::LqnStruct< T >::callproc_mean |
(ncalls+1) mean number of calls
Definition at line 311 of file lqn_struct.h.
| std::vector<std::vector<std::size_t> > line::lqn::LqnStruct< T >::callsof |
(nidx+1) call indices issued by an activity
Definition at line 306 of file lqn_struct.h.
| std::vector<CallType> line::lqn::LqnStruct< T >::calltype |
(ncalls+1)
Definition at line 310 of file lqn_struct.h.
| std::vector<CdScaling<T> > line::lqn::LqnStruct< T >::cdscaling |
(tshift+ntasks+1)
Definition at line 238 of file lqn_struct.h.
| std::vector<std::vector<T> > line::lqn::LqnStruct< T >::cdscalingpeak |
(tshift+ntasks+1)
Definition at line 239 of file lqn_struct.h.
| std::size_t line::lqn::LqnStruct< T >::cshift = 0 |
Definition at line 210 of file lqn_struct.h.
| SparseGraph<T> line::lqn::LqnStruct< T >::dag |
graph with entry-task edges reversed and loop back-edges removed
Definition at line 316 of file lqn_struct.h.
| std::vector<Distrib<T> > line::lqn::LqnStruct< T >::delayofftime |
Definition at line 295 of file lqn_struct.h.
| std::vector<std::vector<std::size_t> > line::lqn::LqnStruct< T >::entriesof |
(tshift+ntasks+1)
Definition at line 304 of file lqn_struct.h.
| std::size_t line::lqn::LqnStruct< T >::eshift = 0 |
Definition at line 210 of file lqn_struct.h.
| std::map<std::pair<std::size_t, std::size_t>, double> line::lqn::LqnStruct< T >::fanin |
Definition at line 256 of file lqn_struct.h.
| std::map<std::pair<std::size_t, std::size_t>, double> line::lqn::LqnStruct< T >::fanout |
Fan-out and fan-in, keyed by task element index, absent = 0.
fanout[{caller, callee}] is how many callee replicas one caller replica addresses, and is read by SolverLN to decide whether a replicated task layer can be pooled into a single station instead of materialised once per replica (getStruct.m builds the same matrix as lsn.fanout). fanin is the mirror declaration and is carried for round-trip fidelity only: no analyzer in ANY codebase reads it, MATLAB and the JAR likewise park it on the Task and never consult it.
Definition at line 255 of file lqn_struct.h.
| SparseGraph<T> line::lqn::LqnStruct< T >::graph |
element call/precedence graph, edge weights are branch shares
Definition at line 315 of file lqn_struct.h.
| std::vector<bool> line::lqn::LqnStruct< T >::has_arrival |
(nidx+1) entry with an open arrival
Definition at line 300 of file lqn_struct.h.
| std::vector<std::string> line::lqn::LqnStruct< T >::hashnames |
(nidx+1) name prefixed by kind: P:/T:/R:/E:/A:
Definition at line 213 of file lqn_struct.h.
| std::vector<bool> line::lqn::LqnStruct< T >::hassetup |
(tshift+ntasks+1)
Definition at line 267 of file lqn_struct.h.
| std::vector<Distrib<T> > line::lqn::LqnStruct< T >::hostdem |
(nidx+1) host demand per activity (Immediate elsewhere)
Definition at line 297 of file lqn_struct.h.
| std::size_t line::lqn::LqnStruct< T >::hshift = 0 |
Definition at line 210 of file lqn_struct.h.
| BoolGraph line::lqn::LqnStruct< T >::isasynccaller |
Definition at line 318 of file lqn_struct.h.
| std::vector<bool> line::lqn::LqnStruct< T >::iscache |
(tshift+ntasks+1)
Definition at line 266 of file lqn_struct.h.
| BoolGraph line::lqn::LqnStruct< T >::iscaller |
Definition at line 318 of file lqn_struct.h.
| std::vector<bool> line::lqn::LqnStruct< T >::isref |
(tshift+ntasks+1)
Definition at line 265 of file lqn_struct.h.
| BoolGraph line::lqn::LqnStruct< T >::issynccaller |
Definition at line 318 of file lqn_struct.h.
| std::vector<std::vector<int> > line::lqn::LqnStruct< T >::itemcap |
(tshift+ntasks+1)
Definition at line 282 of file lqn_struct.h.
| std::vector<std::vector<T> > line::lqn::LqnStruct< T >::itemproc |
(nidx+1) popularity pmf
Definition at line 284 of file lqn_struct.h.
| std::vector<CdScaling<T> > line::lqn::LqnStruct< T >::jdscaling |
(tshift+ntasks+1)
Definition at line 240 of file lqn_struct.h.
| std::vector<std::vector<T> > line::lqn::LqnStruct< T >::jdscalingpeak |
(tshift+ntasks+1)
Definition at line 241 of file lqn_struct.h.
| std::vector<Matrix<T> > line::lqn::LqnStruct< T >::lincon_A |
Admission constraint A n <= b on the layer station of a host or task.
(tshift+ntasks+1); an empty A means unconstrained. The COLUMNS are that host's tasks (tasksof) or that task's entries (entriesof), in that order – element space, not class space. SolverLN::build_layer expands them into the layer's own classes and emits a Region on the server, an entry column becoming the CALL classes that target it and a task column the ACTIVITY classes of that task. Carried by the JSON interchange as admissionConstraints, NOT by .lqnx. See _kb/04-networkstruct.md.
Definition at line 331 of file lqn_struct.h.
| std::vector<std::vector<T> > line::lqn::LqnStruct< T >::lincon_b |
Definition at line 332 of file lqn_struct.h.
| std::vector<std::vector<T> > line::lqn::LqnStruct< T >::lldscaling |
Queue-dependent service rates declared on a layer server (a host or a task), by element index, empty where absent.
lldscaling[i] is the vector alpha(n) applied at total population n; cdscaling[i] and jdscaling[i] are the per-OPERAND handles beta(n) and eta(n), whose argument counts the jobs the layer station holds on behalf of task j of a host or entry j of a task, in declaration order. The peak vectors are required beside the handles, since utilization at such a station is reported as U = T*S/peak. pools carries a compatibility declaration, which SolverLN lowers to a jdscaling of its own.
Only the class-switching layer builders emit these; the composed phase-type law replaces the station by an entry law and so refuses them by name – see _kb/04-networkstruct.md and _kb/06-solver-catalog.md. (tshift+ntasks+1)
Definition at line 237 of file lqn_struct.h.
| std::vector<double> line::lqn::LqnStruct< T >::maxmult |
(tshift+ntasks+1) sustainable multiplicity
Definition at line 218 of file lqn_struct.h.
| std::vector<double> line::lqn::LqnStruct< T >::mult |
(tshift+ntasks+1) declared multiplicity, may be Inf
Definition at line 217 of file lqn_struct.h.
| std::size_t line::lqn::LqnStruct< T >::nacts = 0 |
Definition at line 209 of file lqn_struct.h.
| std::vector<std::string> line::lqn::LqnStruct< T >::names |
(nidx+1) declared name
Definition at line 212 of file lqn_struct.h.
| std::size_t line::lqn::LqnStruct< T >::ncalls = 0 |
Definition at line 209 of file lqn_struct.h.
| std::size_t line::lqn::LqnStruct< T >::nentries = 0 |
Definition at line 209 of file lqn_struct.h.
| std::size_t line::lqn::LqnStruct< T >::nhosts = 0 |
Definition at line 209 of file lqn_struct.h.
| std::size_t line::lqn::LqnStruct< T >::nidx = 0 |
Definition at line 209 of file lqn_struct.h.
| std::vector<std::size_t> line::lqn::LqnStruct< T >::nitems |
Cache tasks and item entries.
nitems is indexed by ELEMENT and carries the item population on BOTH the cache task and each of its item entries, which is how getStruct.m writes it (iscache is the nitems>0 test, over hosts+tasks only). itemcap is the capacity of each cache list, so a plain single-level cache has one entry. itemproc is the item POPULARITY of an item entry, as an explicit pmf over its nitems: the reference stores a discrete Distribution (a Zipf, typically) and only ever reads its pmf, and this port has no discrete-distribution type to put there. (nidx+1)
Definition at line 281 of file lqn_struct.h.
| std::size_t line::lqn::LqnStruct< T >::ntasks = 0 |
Definition at line 209 of file lqn_struct.h.
| std::vector<std::size_t> line::lqn::LqnStruct< T >::parent |
(nidx+1) host of a task, task of an entry/activity
Definition at line 215 of file lqn_struct.h.
| std::vector<ServerPools<T> > line::lqn::LqnStruct< T >::pools |
(tshift+ntasks+1)
Definition at line 242 of file lqn_struct.h.
| std::vector<std::vector<LqnPrecedence<T> > > line::lqn::LqnStruct< T >::precedences |
Activity precedences of each task, as DECLARED, indexed by the task's absolute index.
graph is the same information after the reader has expanded it into arcs, and that expansion is lossy for a loop: the back edge carries the branch PROBABILITY 1 - 1/count, so recovering the count from it inverts a division and loses the distinction between a loop and an ordinary cycle. SolverLN method 'srvn.ph' composes the activity graph into a phase-type law instead of routing it, and needs the count, so it reads this. Every other consumer reads graph. (tshift+ntasks+1)
Definition at line 346 of file lqn_struct.h.
| std::vector<double> line::lqn::LqnStruct< T >::repl |
(tshift+ntasks+1) replication
Definition at line 219 of file lqn_struct.h.
| std::vector<ReplacementStrategy> line::lqn::LqnStruct< T >::replacestrat |
(tshift+ntasks+1)
Definition at line 283 of file lqn_struct.h.
| std::vector<SchedStrategy> line::lqn::LqnStruct< T >::sched |
(tshift+ntasks+1)
Definition at line 216 of file lqn_struct.h.
| std::vector<Distrib<T> > line::lqn::LqnStruct< T >::setuptime |
Setup tasks: the server powers down when idle and pays to restart.
(tshift+ntasks+1); hassetup is the "a setup time is declared and is neither Immediate nor sub-tolerance" test, matching how the reference gates the feature in LQN2QN's functionTimesOf rather than the bare ~isempty of getStruct.
Definition at line 294 of file lqn_struct.h.
| SparseGraph<T> line::lqn::LqnStruct< T >::taskgraph |
task-to-task calls
Definition at line 317 of file lqn_struct.h.
| std::vector<std::vector<std::size_t> > line::lqn::LqnStruct< T >::tasksof |
(nhosts+1)
Definition at line 303 of file lqn_struct.h.
| std::vector<Distrib<T> > line::lqn::LqnStruct< T >::think |
(nidx+1) task think time
Definition at line 298 of file lqn_struct.h.
| std::size_t line::lqn::LqnStruct< T >::tshift = 0 |
Definition at line 210 of file lqn_struct.h.
| std::vector<LqnElement> line::lqn::LqnStruct< T >::type |
(nidx+1)
Definition at line 214 of file lqn_struct.h.