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

Port of matlab/src/api/infer/sn_set_service_coc.m: overwrite the service process of one (station, class) pair of a NetworkStruct with a Markovian law fitted to a rate and an SCV, the way the inference routines (infer_fmlps, infer_mlps and the Gibbs samplers) vary a demand without rebuilding the model. More...

#include <cmath>
#include <cstddef>
#include <limits>
#include "line/lang/lang_types.h"
#include "line/lang/qn/network_struct.h"
#include "line/num/number.h"
#include "line/util/error.h"
Include dependency graph for sn_set_service_coc.h:

Go to the source code of this file.

Namespaces

namespace  line
 Conservation laws of a layered queueing network, enumerated from its structure.
namespace  line::api

Functions

template<class T>
void line::api::sn_set_service_coc (qn::NetworkStruct< T > &sn, std::size_t stationIdx, std::size_t classIdx, const T &rate, const T &scv)
 Set the service process of (stationIdx, classIdx) from a rate and an SCV, the reference's sn_set_service_coc(sn, stationIdx, classIdx, rate, scv).
template<class T>
void line::api::sn_set_service_coc (qn::NetworkStruct< T > &sn, std::size_t stationIdx, std::size_t classIdx, const T &rate)
 sn_set_service_coc with the reference's default scv = 1.

Detailed Description

Port of matlab/src/api/infer/sn_set_service_coc.m: overwrite the service process of one (station, class) pair of a NetworkStruct with a Markovian law fitted to a rate and an SCV, the way the inference routines (infer_fmlps, infer_mlps and the Gibbs samplers) vary a demand without rebuilding the model.

The reference writes sn.rates, sn.scv and then, for a finite positive rate, the representation sn.proc, sn.procid, sn.phases, sn.phasessz, sn.phaseshift, sn.mu, sn.phi and sn.pie. The C++ NetworkStruct derives every one of those from the stored Distrib on demand (procid, phases_of, phasessz_of, dist_to_map), so the port stores the fitted Distrib through set_service and writes rates/scv directly, which is the same state.

The fit is the reference's: SCV within 1e-10 of one (or NaN) gives an exponential; SCV below one an Erlang with k = max(1, ceil(1/scv)) phases (map_erlang); SCV above one the two-phase hyperexponential of kpctoolbox's map_hyperexp(mean, scv), whose balanced construction starts from p = 0.99 and divides p by ten until a feasible pair of rates appears, falling back to an exponential when none does.

Definition in file sn_set_service_coc.h.