LINE Solver (C++)
Templated C++ port of the LINE queueing solver
Loading...
Searching...
No Matches
infer_lqn_setparams.h File Reference

Apply a parameter vector to a LayeredNetworkStruct, and read it back. More...

#include <cstddef>
#include <string>
#include <vector>
#include "line/lang/lang_types.h"
#include "line/lang/lqn/lqn_struct.h"
#include "line/num/number.h"
#include "line/util/error.h"
Include dependency graph for infer_lqn_setparams.h:

Go to the source code of this file.

Classes

struct  line::infer::LqnParamSpec
 One row of MATLAB's PARAMSPEC struct array. More...

Namespaces

namespace  line
namespace  line::infer

Enumerations

enum class  line::infer::LqnParamType { line::infer::HOSTDEM , line::infer::THINK }
 The two parameter kinds MATLAB's paramSpec(i).type names. More...

Functions

template<class T>
std::vector< T > line::infer::infer_lqn_getparams (const lqn::LqnStruct< T > &lsn, const std::vector< LqnParamSpec > &spec)
 Read the current values of the parameters named in spec.
template<class T>
void line::infer::infer_lqn_setparams (lqn::LqnStruct< T > &lsn, const std::vector< LqnParamSpec > &spec, const std::vector< T > &a)
 Set the parameters named in spec to the values in a, in place.

Detailed Description

Apply a parameter vector to a LayeredNetworkStruct, and read it back.

Templated port of matlab/src/api/infer/infer_lqn_setparams.m, plus the getparams half that MATLAB keeps as a local function inside infer_lqn.m. No JAR counterpart. This is the parameter-injection side of the LQN parameter identification method; the filter itself is in infer_lqn_ekf.h and the driver in infer_lqn.h.

A parameter is named by an element name and a kind: HOSTDEM the mean host demand of an ACTIVITY THINK the mean think time of a TASK

Means are injected as EXPONENTIAL laws (SCV 1), which is the assumption of the CASCON 2005 tracking method. Injecting the mean while keeping the previous shape would make the observation map depend on a shape the filter never estimates, so the reference does not do it and neither does this port.

MATLAB mutates the model objects and then invalidates model.lsn so the next solve re-reads them. The C++ port operates on the STRUCT directly, which is what the solvers consume, so there is no cache to invalidate; the caller is responsible for handing the mutated struct back to the solver.

The lookup is by declared name over the whole element list, so a name that denotes both a task and an activity is ambiguous. The kind resolves it: HOSTDEM searches ACTIVITY elements only and THINK searches TASK elements only, which is exactly what MATLAB's model.activities and model.tasks lists do and is stricter than a bare name search over names.

ARITHMETIC: assignment only, so any T works.

Definition in file infer_lqn_setparams.h.