LINE Solver (C++)
Templated C++ port of the LINE queueing solver
Loading...
Searching...
No Matches
line::ctmc::NetworkStruct< T >::Reward Struct Reference

sn.reward: the user-declared reward functions, MATLAB's model.setReward(name, fn). More...

#include <line/lang/qn/network_struct.h>

Collaboration diagram for line::ctmc::NetworkStruct< T >::Reward:

Public Attributes

std::string name
std::function< T(const std::vector< T > &)> fn
std::string kind
 The DECLARATIVE form the reward was built from, when it was: the template name (QLen, Util, Blocking), the 1-based node it is declared at, and the 1-based class it covers (0 = every class).
std::size_t node = 0
std::size_t cls = 0

Detailed Description

template<class T>
struct line::ctmc::NetworkStruct< T >::Reward

sn.reward: the user-declared reward functions, MATLAB's model.setReward(name, fn).

fn is evaluated on the AGGREGATE state row – the per-(station, class) job counts in (ist-1)*K + k order, which is what ctmc_state_space_aggr builds – and not on the detailed state. That is the reference's RewardState contract, and it is what makes a reward portable across disciplines: the caller writes state[q] for a queue length without having to know whether the buffer stores class tags or per-class counts.

Definition at line 986 of file network_struct.h.

Member Data Documentation

◆ cls

template<class T>
std::size_t line::qn::NetworkStruct< T >::Reward::cls = 0

Definition at line 1001 of file network_struct.h.

◆ fn

template<class T>
std::function<T(const std::vector<T>&)> line::qn::NetworkStruct< T >::Reward::fn

Definition at line 988 of file network_struct.h.

◆ kind

template<class T>
std::string line::qn::NetworkStruct< T >::Reward::kind

The DECLARATIVE form the reward was built from, when it was: the template name (QLen, Util, Blocking), the 1-based node it is declared at, and the 1-based class it covers (0 = every class).

A lambda cannot be written back out, so a reward built from one has an empty kind and the writer omits it – which is what linemodel_save does, with a warning, rather than emitting a definition that would be wrong on reload.

Definition at line 999 of file network_struct.h.

◆ name

template<class T>
std::string line::qn::NetworkStruct< T >::Reward::name

Definition at line 987 of file network_struct.h.

◆ node

template<class T>
std::size_t line::qn::NetworkStruct< T >::Reward::node = 0

Definition at line 1000 of file network_struct.h.


The documentation for this struct was generated from the following file: