LINE Solver (C++)
Templated C++ port of the LINE queueing solver
Loading...
Searching...
No Matches
snc_env_poisson.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_POISSON_H
6#define LINE_API_SNC_ENV_POISSON_H
7
8/**
9 * @file
10 * @ingroup api_snc
11 * MGF arrival envelope of a Poisson flow with unit-size jobs.
12 *
13 * `log E[exp(theta*A(0,t))] = lambda*t*(exp(theta)-1)` exactly, so the envelope
14 * is tight with a zero burst term and
15 * `rho(theta) = lambda*(exp(theta)-1)/theta`.
16 *
17 * Port of matlab/src/api/snc/snc_env_poisson.m.
18 */
19
20#include <cmath>
22#include "line/util/error.h"
23
24namespace line {
25namespace snc {
26
27/**
28 * @brief MGF arrival envelope of a Poisson flow with unit-size jobs.
29 *
30 * @param lambda arrival rate, jobs per slot
31 * @param theta Chernoff parameter, theta > 0
32 */
33inline Env snc_env_poisson(double lambda, double theta) {
34 if (lambda < 0)
35 throw UnsupportedError("snc_env_poisson: lambda must be nonnegative");
36 if (theta <= 0) throw UnsupportedError("snc_env_poisson: theta must be positive");
37 return Env{0.0, lambda * (std::exp(theta) - 1.0) / theta};
38}
39
40/** The same envelope as a function of theta. */
41inline Envelope snc_env_poisson_fn(double lambda) {
42 return [lambda](double theta) { return snc_env_poisson(lambda, theta); };
43}
44
45} // namespace snc
46} // namespace line
47
48#endif // LINE_API_SNC_ENV_POISSON_H
UnsupportedError(const std::string &what)
Definition error.h:51
The exception types the port throws.
Envelope snc_env_poisson_fn(double lambda)
The same envelope as a function of theta.
std::function< Env(double)> Envelope
An envelope as a function of the Chernoff parameter.
Definition snc_types.h:48
Env snc_env_poisson(double lambda, double theta)
MGF arrival envelope of a Poisson flow with unit-size jobs.
Shared types of the stochastic network calculus domain.
The pair (sigma, rho) of an envelope evaluated at one theta.
Definition snc_types.h:42