![]() |
LINE Solver (C++)
Templated C++ port of the LINE queueing solver
|
A random environment: a port of matlab/src/lang/Environment.m, restricted to what SolverENV reads out of it. More...
#include <cctype>#include <cstddef>#include <functional>#include <string>#include <vector>#include "line/api/mam/map_moment.h"#include "line/api/mam/mmap_lambda.h"#include "line/api/mc/ctmc_courtois.h"#include "line/lang/distribution.h"#include "line/lang/lang_types.h"#include "line/lang/lqn/lqn_struct.h"#include "line/lang/prior.h"#include "line/lang/qn/network_struct.h"#include "line/util/error.h"#include "line/util/matrix.h"Go to the source code of this file.
Classes | |
| struct | line::env::NodeFailure< T > |
| Environment.nodeFailures{k}: the declarative record of one node breakdown. More... | |
| struct | line::env::EnvStage< T > |
| One stage: a name, a category, and the model in force while it lasts. More... | |
| struct | line::env::EnvArc< T > |
| One arc of the environment process. More... | |
| class | line::env::Environment< T > |
| struct | line::env::Environment< T >::Reliability |
| getReliabilityTable: MTTF, MTTR, MTBF and availability of an environment built out of node breakdowns. More... | |
Namespaces | |
| namespace | line |
| namespace | line::env |
Typedefs | |
| using | line::env::ResetMarginal = std::function<Matrix<double>(const Matrix<double>&)> |
| The reset policy of a transition, resetFun in the reference. | |
| template<class T> | |
| using | line::env::ResetEnvRates |
| resetEnvRatesFun in the reference: the state-dependent environment rate. | |
Functions | |
| ResetMarginal | line::env::env_reset_policy (const std::string &name) |
| The two NAMED reset policies of Environment.resolveResetPolicy, which are the only ones the JSON interchange can carry (a function handle is written as custom and warned about by both writers, never reloaded). | |
| template<class T> | |
| qn::NetworkStruct< T > | line::env::env_degraded_model (const qn::NetworkStruct< T > &base, const std::string &node_name, const lang::Distrib< T > &down_service) |
| The DOWN stage network of addNodeBreakdown: the base network with ONE node's service replaced by its degraded distribution, for EVERY class. | |
A random environment: a port of matlab/src/lang/Environment.m, restricted to what SolverENV reads out of it.
WHAT IT MODELS. A queueing network whose PARAMETERS change over time because the world around it does: a server that breaks down and is repaired, a workload that has a day phase and a night phase, a system that degrades and is reset. Each of those is a STAGE, holding its own complete network, and the environment is a semi-Markov process over the stages. The point is that the network never restarts empty at a switch – the jobs in it at the moment of the switch are carried into the next stage, which is what couples the stages and what makes this more than solving each stage separately.
THE HOLDING TIME IS A COMPETING RISK, and this is the part worth reading the reference for. Every enabled transition e -> h has its own distribution, and they all run at once: the stage ends when the FIRST of them fires, and which one fired decides the next stage. init() therefore superposes the outgoing transitions of e by a Kronecker sum into a single marked process hold_time[e], whose per-mark rates give the embedded jump chain Pemb. The collapse that follows – each block's row sums moved into its FIRST column – is the reference's, and it makes the superposed process restart in phase one after every jump, i.e. renewal at each stage entry.
WHAT init() PRODUCES, and what the solver consumes: proc[e][h] the e -> h transition process, whose CDF weights the stage transient when computing the metrics AT a switch to h hold_time[e] the superposed holding time of stage e, whose CDF weights the transient when computing the metrics OVER the whole stage prob_env[e] the stationary probability of being in stage e prob_orig prob_orig(h, e) = P(the previous stage was h | now entering e)
A DISABLED transition is the 1 x 1 zero pair, exactly as in the reference: krons(A, 0) leaves A unchanged, so a disabled arc costs nothing and needs no special case anywhere below.
NODE BREAKDOWNS are the one stage pattern the reference gives a name to (addNodeBreakdown / addNodeRepair / addNodeFailureRepair): the UP stage holds the base network, the DOWN_<node> stage holds the same network with one node's service replaced by its degraded distribution, and the two arcs between them are the time to failure and the time to repair. It is a macro over set_stage and add_transition and nothing more, EXCEPT for the pair of queue-length reset policies it attaches, which are the only part of a breakdown that the expanded stages cannot express – hence NodeFailure, which records them beside the stages so an environment read back from model.json is the same model it was written from.
Definition in file environment.h.