LINE Solver (C++)
Templated C++ port of the LINE queueing solver
Toggle main menu visibility
Loading...
Searching...
No Matches
qsys_mm1.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2012-2026, QORE Lab, Imperial College London
3
* All rights reserved.
4
*/
5
#ifndef LINE_API_QSYS_MM1_H
6
#define LINE_API_QSYS_MM1_H
7
8
/**
9
* @file
10
* @ingroup api_qsys
11
* Exact mean response time of the M/M/1 queue.
12
*
13
* Templated port of matlab/src/api/qsys/qsys_mm1.m, cross-checked against
14
* jar/src/main/java/jline/api/qsys/Qsys_mm1.java (identical).
15
*
16
* rho = lambda/mu, W = rho/(1-rho)/lambda
17
*
18
* Pure field arithmetic, so the function is exact for T = Rational.
19
*/
20
21
#include "
line/api/qsys/qsys_types.h
"
22
#include "
line/num/number.h
"
23
24
namespace
line
{
25
namespace
qsys
{
26
27
/**
28
* @brief Exact mean response time of the M/M/1 queue.
29
*
30
* @param lambda arrival rate
31
* @param mu service rate
32
* @return W = mean response time, rhohat = rho (MATLAB returns the true rho here)
33
*/
34
template
<
class
T>
35
QsysResult<T>
qsys_mm1
(
const
T& lambda,
const
T& mu) {
36
const
T one =
num_traits<T>::from_int
(1);
37
const
T rho = lambda / mu;
38
detail::require_no_pole(T(one - rho),
"qsys_mm1"
);
39
const
T W = rho / (one - rho) / lambda;
40
return
{W, rho};
41
}
42
43
}
// namespace qsys
44
}
// namespace line
45
46
#endif
// LINE_API_QSYS_MM1_H
line::qsys
Definition
qsys_bmapm1.h:58
line::qsys::qsys_mm1
QsysResult< T > qsys_mm1(const T &lambda, const T &mu)
Exact mean response time of the M/M/1 queue.
Definition
qsys_mm1.h:35
line
Definition
aoi_dist2ph.h:52
number.h
Number-type abstraction for the templated API port.
qsys_types.h
Shared return type and arithmetic helpers for the templated qsys port.
line::num_traits
Definition
number.h:111
line::qsys::QsysResult
Return value of the qsys family, mirroring MATLAB's [W,rhohat] and the JAR's Ret.qsys.
Definition
qsys_types.h:37
include
line
api
qsys
qsys_mm1.h
Generated by
1.18.0