![]() |
LINE Solver (C++)
Templated C++ port of the LINE queueing solver
|
Identify hidden LQN parameters from measured performance data. More...
#include <cstddef>#include <functional>#include <vector>#include "line/api/infer/infer_lqn_ekf.h"#include "line/api/infer/infer_lqn_getobs.h"#include "line/api/infer/infer_lqn_setparams.h"#include "line/lang/lqn/lqn_struct.h"#include "line/num/number.h"#include "line/util/error.h"#include "line/util/matrix.h"Go to the source code of this file.
Classes | |
| struct | line::infer::InferLqnOptions< T > |
| MATLAB's OPTIONS struct for infer_lqn, with the same defaults the infer_lqn_optget calls supply. More... | |
| struct | line::infer::InferLqnResult< T > |
| MATLAB's INFO struct: the EKF result plus what the driver constructed. More... | |
Namespaces | |
| namespace | line |
| namespace | line::infer |
Functions | |
| template<class T> | |
| InferLqnResult< T > | line::infer::infer_lqn (lqn::LqnStruct< T > &lsn, const std::vector< LqnParamSpec > &spec, const std::vector< LqnObsSpec > &obs, const Matrix< T > &Z, const std::function< LqnMetrics< T >(const lqn::LqnStruct< T > &)> &solve, const InferLqnOptions< T > &opt=InferLqnOptions< T >()) |
| Identify hidden LQN parameters from measured performance data. | |
Identify hidden LQN parameters from measured performance data.
Templated port of matlab/src/api/infer/infer_lqn.m. No JAR counterpart. Estimates the LQN parameters named in spec (activity host demands and task think times) from the sequence of measurements Z, using the Extended Kalman Filter of infer_lqn_ekf.h over the observation model defined by obs. It implements Zheng, Yang, Woodside, Litoiu, Iszlai, "Tracking Time-Varying Parameters in Software Systems with Extended Kalman Filters", CASCON 2005. A single measurement column with QFac = 0 reduces to one-shot least-squares calibration.
The DEFAULT COVARIANCES are the paper's equations (9a) and (9b): Q_ii = (QFac a0_i cvA)^2, taking mean(a_i) ~ a0_i R_ii = ((RFac zbar_i)/1.96)^2 / gammaT, with zbar_i the mean of the i-th measured row over the steps and P0 = diag((0.5 a0)^2). Each is overridable, and each is floored at the machine epsilon exactly as MATLAB floors it: a parameter whose initial estimate is zero would otherwise give a singular Q and stall the filter on that coordinate forever.
gammaT is T/Tstar when both are supplied and 1 otherwise, which is what MATLAB's cascade of infer_lqn_optget calls resolves to.
THE OBSERVATION MODEL is a required argument here rather than the defaulted @SolverLN of MATLAB. It is MATLAB's options.solver, and in C++ the caller passes the solve step directly: injecting a default would make api/infer depend on the whole layered solver, and the algorithm is identical either way. The callable receives the struct with the candidate parameters already injected and returns the per-element metric vectors that infer_lqn_getobs selects from.
The final estimate is applied to the struct before returning, so the caller gets back a model carrying the identified parameters, as in MATLAB.
ARITHMETIC: the filter needs transcendental arithmetic (see infer_lqn_ekf.h), so the exact instantiation is refused.
Definition in file infer_lqn.h.