LINE Solver (C++)
Templated C++ port of the LINE queueing solver
Loading...
Searching...
No Matches
avg_table.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2012-2026, QORE Lab, Imperial College London
3 * All rights reserved.
4 */
5#ifndef LINE_SOLVERS_AVG_TABLE_H
6#define LINE_SOLVERS_AVG_TABLE_H
7
8/**
9 * @file
10 * @ingroup line_solvers
11 * @ingroup line_public
12 * The result tables a solver returns.
13 *
14 * `AvgTable` is what Python's `getAvgTable()` returns and what this port spells
15 * `avg_table()`: one row per (station, class) that carries a metric, plus the
16 * per-class system columns `getAvgSysTable()` reports. The columns are the
17 * reference's own -- QLen, Util, RespT, ResidT, ArvR, Tput -- and a
18 * (station, class) pair with no row is a zero, not a gap.
19 *
20 * THESE TYPES CARRY NO SOLVER MACHINERY ON PURPOSE. The solver templates are a
21 * heavy instantiation, so this header stays free of them and every example,
22 * test and CLI translation unit can name a result without paying for the stack
23 * that produced it; `line/solvers/solver.h` declares the solvers themselves and
24 * their bodies are compiled once into `line_mp_api`.
25 */
26
27#include <cstddef>
28#include <string>
29#include <vector>
30
31namespace line {
32
33/** `getAvgTable`, one row per (station, class) that carries a metric. */
34struct AvgTable {
35 std::vector<std::string> Station, JobClass;
36 std::vector<double> QLen, Util, RespT, ResidT, ArvR, Tput;
37 /** `getAvgSysTable`: system response time and throughput, per class. */
38 std::vector<std::string> SysClass;
39 std::vector<double> SysRespT, SysTput;
40 std::string solver, method;
41 int iter = 0;
42 bool has_lognormconst = false;
43 double lognormconst = 0.0;
44 /** `getAvgCacheTable`'s ListCost column; empty on a model without item sizes. */
45 std::vector<double> ListCost;
46 /** The reference's own warning text, empty when it did not warn. */
47 std::string warning;
48
49 /** One cell of the table, by station and class NAME; NaN when absent. */
50 double get(const std::string& column, const std::string& station,
51 const std::string& jobclass) const;
52 /** The column of a station over every class it has a row for. */
53 std::vector<double> column(const std::string& column) const;
54 /** The number of rows the table carries. */
55 std::size_t size() const { return Station.size(); }
56 bool empty() const { return Station.empty(); }
57};
58
59/** `SolverBA(model, method).getBoundsTable()`. */
61 std::vector<std::string> Station, JobClass;
62 std::vector<double> Qlower, Qupper, Tlower, Tupper;
63 std::string method;
64};
65
66/** One response-time CDF curve: `F` the CDF value, `t` the time it is reached. */
67struct CdfCurve {
68 std::vector<double> F, t;
69};
70
71/** `getTranAvg`: the transient mean queue length per (station, class). */
72struct TranAvg {
73 std::vector<double> t; ///< the time axis
74 std::vector<std::vector<double> > QNt; ///< [step][station*class]
75 std::vector<std::string> label; ///< the (station, class) of each column
76};
77
78} // namespace line
79
80#endif // LINE_SOLVERS_AVG_TABLE_H
getAvgTable, one row per (station, class) that carries a metric.
Definition avg_table.h:34
std::vector< double > ArvR
Definition avg_table.h:36
std::vector< double > Tput
Definition avg_table.h:36
std::vector< double > ResidT
Definition avg_table.h:36
std::vector< double > RespT
Definition avg_table.h:36
std::size_t size() const
The number of rows the table carries.
Definition avg_table.h:55
double lognormconst
Definition avg_table.h:43
std::vector< double > Util
Definition avg_table.h:36
std::vector< std::string > Station
Definition avg_table.h:35
std::vector< double > column(const std::string &column) const
The column of a station over every class it has a row for.
std::vector< double > SysTput
Definition avg_table.h:39
bool empty() const
Definition avg_table.h:56
std::vector< std::string > JobClass
Definition avg_table.h:35
std::string warning
The reference's own warning text, empty when it did not warn.
Definition avg_table.h:47
double get(const std::string &column, const std::string &station, const std::string &jobclass) const
One cell of the table, by station and class NAME; NaN when absent.
std::string solver
Definition avg_table.h:40
std::string method
Definition avg_table.h:40
bool has_lognormconst
Definition avg_table.h:42
std::vector< double > ListCost
getAvgCacheTable's ListCost column; empty on a model without item sizes.
Definition avg_table.h:45
std::vector< double > SysRespT
Definition avg_table.h:39
std::vector< std::string > SysClass
getAvgSysTable: system response time and throughput, per class.
Definition avg_table.h:38
std::vector< double > QLen
Definition avg_table.h:36
SolverBA(model, method).getBoundsTable().
Definition avg_table.h:60
std::vector< double > Tlower
Definition avg_table.h:62
std::string method
Definition avg_table.h:63
std::vector< double > Qupper
Definition avg_table.h:62
std::vector< std::string > Station
Definition avg_table.h:61
std::vector< double > Qlower
Definition avg_table.h:62
std::vector< std::string > JobClass
Definition avg_table.h:61
std::vector< double > Tupper
Definition avg_table.h:62
One response-time CDF curve: F the CDF value, t the time it is reached.
Definition avg_table.h:67
std::vector< double > F
Definition avg_table.h:68
std::vector< double > t
Definition avg_table.h:68
getTranAvg: the transient mean queue length per (station, class).
Definition avg_table.h:72
std::vector< std::string > label
the (station, class) of each column
Definition avg_table.h:75
std::vector< std::vector< double > > QNt
[step][station*class]
Definition avg_table.h:74
std::vector< double > t
the time axis
Definition avg_table.h:73