LINE Solver (C++)
Templated C++ port of the LINE queueing solver
Toggle main menu visibility
Loading...
Searching...
No Matches
snc_env_cpoisson.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_SNC_ENV_CPOISSON_H
6
#define LINE_API_SNC_ENV_CPOISSON_H
7
8
/**
9
* @file
10
* @ingroup api_snc
11
* MGF arrival envelope of a compound Poisson flow with Exp job sizes.
12
*
13
* Jobs arrive Poisson at rate lambda and each carries an Exp(mu) amount of work,
14
* so `rho(theta) = lambda/(mu-theta)` for `0 < theta < mu` and the burst is
15
* zero. Fed to a constant-rate server of rate mu (`snc_srv_rate`) this is the
16
* network calculus model of the M/M/1 queue in units of WORK, and the delay
17
* bound then decays at the exact rate mu-lambda.
18
*
19
* INFEASIBILITY IS A VALUE, NOT AN ERROR: at `theta >= mu` the job-size MGF
20
* diverges and rho is returned as infinity, which the theta search discards.
21
*
22
* Port of matlab/src/api/snc/snc_env_cpoisson.m.
23
*/
24
25
#include <cmath>
26
#include <limits>
27
#include "
line/api/snc/snc_types.h
"
28
#include "
line/util/error.h
"
29
30
namespace
line
{
31
namespace
snc
{
32
33
/**
34
* @brief MGF arrival envelope of a compound Poisson flow with Exp job sizes.
35
*
36
* @param lambda job arrival rate, jobs per slot
37
* @param mu rate of the Exp job size, so the mean work per job is 1/mu
38
* @param theta Chernoff parameter, theta > 0
39
*/
40
inline
Env
snc_env_cpoisson
(
double
lambda,
double
mu,
double
theta) {
41
if
(lambda < 0 || mu <= 0)
42
throw
UnsupportedError
(
"snc_env_cpoisson: lambda must be nonnegative and mu positive"
);
43
if
(theta <= 0)
throw
UnsupportedError
(
"snc_env_cpoisson: theta must be positive"
);
44
if
(theta >= mu)
return
Env
{0.0, std::numeric_limits<double>::infinity()};
45
return
Env
{0.0, lambda / (mu - theta)};
46
}
47
48
/** The same envelope as a function of theta. */
49
inline
Envelope
snc_env_cpoisson_fn
(
double
lambda,
double
mu) {
50
return
[lambda, mu](
double
theta) {
return
snc_env_cpoisson
(lambda, mu, theta); };
51
}
52
53
}
// namespace snc
54
}
// namespace line
55
56
#endif
// LINE_API_SNC_ENV_CPOISSON_H
line::UnsupportedError::UnsupportedError
UnsupportedError(const std::string &what)
Definition
error.h:51
error.h
The exception types the port throws.
line::snc
Definition
snc_bound_backlog.h:34
line::snc::Envelope
std::function< Env(double)> Envelope
An envelope as a function of the Chernoff parameter.
Definition
snc_types.h:48
line::snc::snc_env_cpoisson_fn
Envelope snc_env_cpoisson_fn(double lambda, double mu)
The same envelope as a function of theta.
Definition
snc_env_cpoisson.h:49
line::snc::snc_env_cpoisson
Env snc_env_cpoisson(double lambda, double mu, double theta)
MGF arrival envelope of a compound Poisson flow with Exp job sizes.
Definition
snc_env_cpoisson.h:40
line
Definition
aoi_dist2ph.h:52
snc_types.h
Shared types of the stochastic network calculus domain.
line::snc::Env
The pair (sigma, rho) of an envelope evaluated at one theta.
Definition
snc_types.h:42
include
line
api
snc
snc_env_cpoisson.h
Generated by
1.18.0