LINE Solver (C++)
Templated C++ port of the LINE queueing solver
Loading...
Searching...
No Matches
snc_srv_rate.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_SRV_RATE_H
6#define LINE_API_SNC_SRV_RATE_H
7
8/**
9 * @file
10 * @ingroup api_snc
11 * MGF service envelope of a constant-rate work-conserving server.
12 *
13 * `S(s,t) = C*(t-s)`, so `(sigma, rho) = (0, C)` for every theta. This is the
14 * elementary service element; a station shared by cross traffic follows from it
15 * through `snc_leftover` and a tandem through `snc_conv`.
16 *
17 * USE `snc_srv_exp` INSTEAD WHENEVER THE WORK UNIT IS THE JOB: pairing this
18 * element with a job-counting arrival envelope models an M/D/1 and understates
19 * the delay of an exponential server.
20 *
21 * Port of matlab/src/api/snc/snc_srv_rate.m.
22 */
23
25#include "line/util/error.h"
26
27namespace line {
28namespace snc {
29
30/**
31 * @brief MGF service envelope of a constant-rate work-conserving server.
32 *
33 * @param C server capacity, work per slot
34 */
35inline Env snc_srv_rate(double C) {
36 if (C <= 0) throw UnsupportedError("snc_srv_rate: C must be positive");
37 return Env{0.0, C};
38}
39
40/**
41 * @brief MGF service envelope of a constant-rate work-conserving server.
42 *
43 * @param theta accepted and ignored, for signature compatibility
44 */
45inline Env snc_srv_rate(double C, double theta) {
46 if (theta <= 0) throw UnsupportedError("snc_srv_rate: theta must be positive");
47 return snc_srv_rate(C);
48}
49
50/** The same envelope as a function of theta. */
51inline Envelope snc_srv_rate_fn(double C) {
52 return [C](double theta) { return snc_srv_rate(C, theta); };
53}
54
55} // namespace snc
56} // namespace line
57
58#endif // LINE_API_SNC_SRV_RATE_H
UnsupportedError(const std::string &what)
Definition error.h:51
The exception types the port throws.
Envelope snc_srv_rate_fn(double C)
The same envelope as a function of theta.
Env snc_srv_rate(double C)
MGF service envelope of a constant-rate work-conserving server.
std::function< Env(double)> Envelope
An envelope as a function of the Chernoff parameter.
Definition snc_types.h:48
Shared types of the stochastic network calculus domain.
The pair (sigma, rho) of an envelope evaluated at one theta.
Definition snc_types.h:42