5#ifndef LINE_API_SN_SN_PATIENCE_HANDLES_H
6#define LINE_API_SN_SN_PATIENCE_HANDLES_H
48 std::function<T(
const T&)>
ccdf;
50 std::function<T(
const T&)>
pdf;
103 if (ist >=
sn.nstations || r >=
sn.nclasses)
return std::string();
108 return std::string();
111 ", not a Markovian law (the patience must be a Markovian law: Exp, Erlang, HyperExp, "
112 "Coxian, APH or PH).";
118 for (std::size_t i = 0; i <
sn.nstations; ++i)
119 for (std::size_t r = 0; r <
sn.nclasses; ++r) {
121 if (!why.empty())
return why;
123 return std::string();
137 if (ist >=
sn.stations.size())
return std::string();
141 return std::string();
143 ", not an exponential law (the patience must be an exponential law: Exp).";
149 for (std::size_t i = 0; i <
sn.stations.size(); ++i)
150 for (std::size_t r = 0; r <
sn.stations[i].impatience.size(); ++r) {
152 if (!why.empty())
return why;
154 return std::string();
168 if (ist >=
sn.nstations || r >=
sn.nclasses)
return h;
192 const T theta = h.
rate;
193 h.
ccdf = [theta](
const T& t) {
return qsys::detail::num_exp(T(-theta * t)); };
194 h.
pdf = [theta](
const T& t) {
return T(theta * qsys::detail::num_exp(T(-theta * t))); };
195 h.
hazard = [theta](
const T&) {
return theta; };
200 h.
ccdf = [m, one](
const T& t) {
201 std::vector<T> pts(1, t);
204 h.
pdf = [m](
const T& t) {
205 std::vector<T> pts(1, t);
208 const T asymptotic = h.
rate;
209 std::function<T(
const T&)> ccdf = h.
ccdf;
210 std::function<T(
const T&)> pdf = h.
pdf;
211 h.
hazard = [ccdf, pdf, asymptotic](
const T& t) {
217 return T(pdf(t) / c);
A network plus its refreshed NetworkStruct.
What refreshProcessRepresentations and refreshLST compute FROM a distribution: the (D0,...
Enumerations and the minimal distribution descriptor shared by the model layer of the C++ port.
Cumulative distribution of the inter-arrival time of a MAP.
Probability density of the inter-arrival time of a MAP.
PatienceHandles< T > sn_patience_handles(const qn::NetworkStruct< T > &sn, std::size_t ist, std::size_t r)
Build the patience handles of station ist (0-based), class r.
std::string sn_patience_exp_refusal(const qn::NetworkStruct< T > &sn, std::size_t ist, std::size_t r)
Port of sn_patience_exp_refusal.m: the by-name refusal of a reneging patience that is not EXPONENTIAL...
std::string sn_patience_refusal(const qn::NetworkStruct< T > &sn, std::size_t ist, std::size_t r)
Port of sn_patience_refusal.m: the by-name refusal of a reneging patience that is not a Markovian law...
bool patience_is_markovian(const lang::Distrib< T > &d)
Is d a Markovian law, i.e.
mam::Map< T > dist_to_map(const Distrib< T > &d)
The (D0,D1) pair that reaches sn.proc.
@ MPH
The MARKED families, MATLAB's ProcessType.m:36-38.
const char * process_to_text(ProcessType p)
The MATLAB ProcessType name, as sn.procid prints it.
std::vector< T > map_cdf(const Map< T > &m, const std::vector< T > &points)
Cumulative distribution of the inter-arrival time at the given points.
std::vector< T > map_pdf(const Map< T > &m, const std::vector< T > &tset)
Probability density of the inter-arrival time at the given points.
Conservation laws of a layered queueing network, enumerated from its structure.
A queueing network and its refreshed NetworkStruct.
Number-type abstraction for the templated API port.
Engineering solution of the call-center model M/GI/s/r+GI.
Shared return type and arithmetic helpers for the templated qsys port.
The patience law of one station-class pair, in the forms the solvers consume.
std::function< T(const T &)> pdf
The patience density.
qsys::Patience< T > as_patience() const
This law as the Patience argument of the abandonment solvers.
std::function< T(const T &)> ccdf
F^c(t) = P(patience > t).
bool present
Whether the pair declares reneging at all; everything below is unset when false.
std::function< T(const T &)> hazard
The hazard rate h = f/(1-F).
bool isExponential
Whether the law is exponential, in which case the analysis is exact.
T rate
The abandonment rate 1/mean.
A MAP as the pair of matrices (D0, D1).
One station of the network.
std::vector< Distrib< T > > patience
Queue.setPatience(class, dist): the abandonment timer of a WAITING job, with impatience[r] naming whi...
std::vector< lang::ImpatienceType > impatience
The patience (time-to-abandon) law, in the three forms the algorithm accepts.
static Patience hazard(std::function< T(const T &)> h)
Patience given by its hazard rate h = f/(1-F).
static Patience exponential(const T &theta)
Exponential patience of rate theta, h(t) = theta, the Erlang A case.