![]() |
LINE Solver (C++)
Templated C++ port of the LINE queueing solver
|
Port of matlab/src/io/@ModelAdapter/tagChain.m: the model-to-model transform that isolates ONE job of a chain so that its passage can be observed. More...
#include <cmath>#include <cstddef>#include <limits>#include <map>#include <string>#include <vector>#include "line/lang/qn/network_struct.h"#include "line/util/error.h"Go to the source code of this file.
Classes | |
| struct | line::qn::TaggedChain< T > |
| The tagged model and the class bookkeeping a caller needs to read it back. More... | |
Namespaces | |
| namespace | line |
| namespace | line::qn |
Functions | |
| template<class T> | |
| TaggedChain< T > | line::qn::tag_chain (const NetworkStruct< T > &sn, std::size_t chain, std::size_t jobclass, const std::string &suffix=".tagged") |
| Tag one class of one chain. | |
Port of matlab/src/io/@ModelAdapter/tagChain.m: the model-to-model transform that isolates ONE job of a chain so that its passage can be observed.
WHAT IT DOES. Every class of the chain gets a TAGGED twin: same service, same routing, same reference station, but its own class index. The chain's population is moved by one job – the class the caller names loses one, its twin gains it – so the transformed model has the same total population and the same stationary behaviour, with one job now distinguishable from the rest. A twin exists for EVERY class of the chain and not only for the tagged one because the tagged job class-switches as it circulates; without the twins it would leave the tagged block on its first switch and stop being tagged.
WHY IT IS A MODEL TRANSFORM AND NOT A POST-PROCESSING STEP. The quantity the response-time CDF needs is the law of the state SEEN BY ONE JOB between its arrival and its departure. The generator of the untagged model has no event that says "this particular job arrived": arrivals of a class are indistinguishable, and the filtration can only split the generator on class- and node-level events. Minting a class with exactly one job in it turns the question into one the filtration can answer.
THE POPULATION BOOKKEEPING IS NOT COSMETIC. The twin carries population 1 at the tagged class and 0 at every other class of the chain, and the original class is decremented by 1. Keeping the original population would enlarge the chain by one job and change the very response time being measured.
WHAT THE REFERENCE DOES THAT THIS DOES NOT. tagChain.m works on a Network object and re-links it, so it re-derives the class-switch nodes from the linked routing matrix P{r,s}. Here the transform is applied to the refreshed NetworkStruct directly, exactly as fj_mmt does, and the tagged routing block is written into P and into any explicit ClassSwitch matrix before a single refresh_struct() re-derives the chains, the capacities and rt. The two routes agree because a chain is closed under class switching: the block of P (and of the class-switch matrix) over the chain's own classes is already stochastic, so copying it onto the tagged classes needs no rebalancing.
Definition in file tag_chain.h.