LINE Solver (C++)
Templated C++ port of the LINE queueing solver
Toggle main menu visibility
Loading...
Searching...
No Matches
snc_output.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_OUTPUT_H
6
#define LINE_API_SNC_OUTPUT_H
7
8
/**
9
* @file
10
* @ingroup api_snc
11
* Output (departure) arrival envelope of a flow leaving a server.
12
*
13
* For independent processes and a stable station,
14
*
15
* rho = rhoA,
16
* sigma = sigmaA + sigmaS - log(1-exp(-theta*(rhoS-rhoA)))/theta.
17
*
18
* The rate is conserved and the server adds burstiness. This is what carries a
19
* flow across a feed-forward network one hop at a time; for a tandem traversed
20
* by the same flow, `snc_conv` gives the tighter end-to-end result.
21
*
22
* Port of matlab/src/api/snc/snc_output.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 Output (departure) arrival envelope of a flow leaving a server.
35
*
36
* @param arv the arrival envelope entering the server
37
* @param srv the service envelope
38
* @param theta Chernoff parameter, theta > 0
39
*/
40
inline
Env
snc_output
(
const
Env
& arv,
const
Env
& srv,
double
theta) {
41
if
(theta <= 0)
throw
UnsupportedError
(
"snc_output: theta must be positive"
);
42
if
(!std::isfinite(arv.
rho
) || !std::isfinite(srv.
rho
) || srv.
rho
<= arv.
rho
)
43
return
Env
{std::numeric_limits<double>::infinity(), arv.
rho
};
44
return
Env
{arv.
sigma
+ srv.
sigma
-
45
std::log(1.0 - std::exp(-theta * (srv.
rho
- arv.
rho
))) / theta,
46
arv.
rho
};
47
}
48
49
}
// namespace snc
50
}
// namespace line
51
52
#endif
// LINE_API_SNC_OUTPUT_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::snc_output
Env snc_output(const Env &arv, const Env &srv, double theta)
Output (departure) arrival envelope of a flow leaving a server.
Definition
snc_output.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
line::snc::Env::sigma
double sigma
Definition
snc_types.h:43
line::snc::Env::rho
double rho
Definition
snc_types.h:44
include
line
api
snc
snc_output.h
Generated by
1.18.0