![]() |
LINE Solver (C++)
Templated C++ port of the LINE queueing solver
|
The NATIVE LDES engine for LAYERED (LQN) models, the C++ twin of jline/solvers/ldes/handlers/Solver_ssj_ln.java. More...
#include <algorithm>#include <cmath>#include <cstddef>#include <cstdint>#include <deque>#include <functional>#include <limits>#include <map>#include <queue>#include <string>#include <vector>#include "line/lang/lqn/lqn_struct.h"#include "line/solvers/ldes/ldes_sampler.h"#include "line/solvers/wrappers/ldes/ldes_options.h"#include "line/util/error.h"#include "line/util/matrix.h"Go to the source code of this file.
Classes | |
| struct | line::ldes::engine::LnEvent |
| One scheduled event of the layered engine. More... | |
| struct | line::ldes::engine::LnEventLater |
| struct | line::ldes::engine::LnJob |
| One in-flight request: a reference-task job somewhere in its call tree. More... | |
| struct | line::ldes::engine::LnResult |
| The layered result: per element, the mean measures. More... | |
| struct | line::ldes::engine::LnEntryCdf |
| One entry's empirical response-time CDF: F[j] = P(R <= t[j]). More... | |
Namespaces | |
| namespace | line |
| namespace | line::ldes |
| namespace | line::ldes::engine |
Enumerations | |
| enum class | line::ldes::engine::ThreadState { line::ldes::engine::ACTIVE , line::ldes::engine::DELAYOFF , line::ldes::engine::OFF , line::ldes::engine::SETUP } |
| Power state of one task thread, mirroring Solver_ssj_ln's THREAD_* constants. More... | |
| enum class | line::ldes::engine::LnColumn { line::ldes::engine::QLen , line::ldes::engine::Util , line::ldes::engine::RespT , line::ldes::engine::ResidT , line::ldes::engine::Tput } |
| A column of the shared layered average table, as line-cli prints it. More... | |
Functions | |
| std::vector< LnEntryCdf > | line::ldes::engine::ldes_ln_cdf_respt (const LnResult &r, std::size_t nentries) |
| The empirical response time CDF of every ENTRY, the getCdfRespTLN of the other codebases: one [F(t), t] table per entry in the LOCAL index space, empty where the run observed nothing. | |
| template<class T> | |
| bool | line::ldes::engine::ln_defined (const lqn::LqnStruct< T > &lsn, const LnResult &r, std::size_t i, LnColumn c) |
| Does the element at i HAVE the quantity in column c? | |
| template<class T> | |
| engine::LnResult | line::ldes::ldes_ln_engine_solve (const lqn::LqnStruct< T > &lsn, const LdesOptions &o) |
| Simulate a layered model in process. | |
Variables | |
| static const std::size_t | line::ldes::engine::NOTHR = static_cast<std::size_t>(-1) |
| Thread index meaning "no thread held", also used for an infinite-thread task. | |
| static const std::size_t | line::ldes::engine::NOTDRAWN = static_cast<std::size_t>(-1) |
| LnJob::calls_left before the repetition count of a call has been drawn. | |
The NATIVE LDES engine for LAYERED (LQN) models, the C++ twin of jline/solvers/ldes/handlers/Solver_ssj_ln.java.
IT IS A DIFFERENT SIMULATOR FROM THE FLAT ONE, not a wrapper around it. A layered model has no jobs circulating over a routing matrix: it has REFERENCE TASKS that think and then invoke an entry, ACTIVITIES that consume host demand, and CALLS that suspend the caller until the callee replies. The decomposition into layers that SolverLN performs is an APPROXIMATION; this engine simulates the layered semantics directly and is therefore the reference the layered solvers are checked against.
THE TWO RESOURCES ARE HELD AT ONCE, and that is the whole content of a layered model. An activity needs a THREAD of its task and a SERVER of its host, and it holds the thread across a synchronous call while the callee runs on a different host entirely. Releasing the thread during the call would turn every synchronous call into an asynchronous one and remove the layered contention the model exists to represent – the answer stays plausible and every utilization falls.
WHAT THIS INCREMENT COVERS: reference tasks with think time and multiplicity, entries with sequential activity graphs, host demand under FCFS / PS / INF host scheduling, task multiplicity as a thread semaphore, synchronous calls (blocking, with a mean call multiplicity) and asynchronous calls (fire and forget), open arrivals at an entry, and REPLICATION of a processor or a task, materialised one queue per copy.
WHAT IT REFUSES by name: activity graphs with AND/OR forks or loops, cache tasks, setup/delay-off on a task, and admission constraints.
Definition in file ldes_ln_engine.h.