LINE Solver (C++)
Templated C++ port of the LINE queueing solver
Toggle main menu visibility
Loading...
Searching...
No Matches
map_count_idc.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_MAM_MAP_COUNT_IDC_H
6
#define LINE_API_MAM_MAP_COUNT_IDC_H
7
8
/**
9
* @file
10
* @ingroup api_mam
11
* Index of dispersion for counts (IDC) of a MAP at resolution t.
12
*
13
* Templated port of matlab/lib/kpctoolbox/map/map_count_idc.m. The IDC of the
14
* counting process A(t) is the scaled variance-time curve
15
* I_a(t) = Var(A(t)) / E[A(t)], t > 0,
16
* interpolating between the interarrival SCV at t->0+ and map_idc at t->Inf
17
* (Whitt-You, "A Robust Queueing Network Analyzer Based on Indices of
18
* Dispersion", eq. 1). It is the traffic descriptor RQNA is built on.
19
*
20
* ARITHMETIC: transcendental. Var(A(t)) needs the matrix exponential
21
* (map_count_var), so this refuses under Rational like its variance input.
22
*/
23
24
#include <cstddef>
25
#include <vector>
26
27
#include "
line/api/mam/map_count_mean.h
"
28
#include "
line/api/mam/map_count_var.h
"
29
#include "
line/api/mam/map_moment.h
"
30
#include "
line/num/number.h
"
31
#include "
line/util/error.h
"
32
33
namespace
line
{
34
namespace
mam
{
35
36
/**
37
* @brief Index of dispersion for counts (IDC) of a MAP at resolution t.
38
*
39
* @param m the MAP (D0, D1)
40
* @param t window lengths (t > 0)
41
* @return the IDC at each window length, in the order of t; 1 where the mean is
42
* zero (an orderly point process is locally Poisson as t -> 0)
43
*/
44
template
<
class
T>
45
std::vector<T>
map_count_idc
(
const
Map<T>
& m,
const
std::vector<T>& t) {
46
static_assert
(
num_traits<T>::has_transcendental
,
47
"map_count_idc requires transcendental arithmetic (matrix exponential)"
);
48
const
std::vector<T> mean =
map_count_mean
(m, t);
49
const
std::vector<T> var =
map_count_var
(m, t);
50
const
T zero =
num_traits<T>::from_int
(0), one =
num_traits<T>::from_int
(1);
51
std::vector<T> out(t.size(), one);
52
for
(std::size_t k = 0; k < t.size(); ++k)
53
if
(mean[k] > zero) out[k] = T(var[k] / mean[k]);
54
return
out;
55
}
56
57
/** Scalar convenience: the IDC at a single window length t. */
58
template
<
class
T>
59
T
map_count_idc
(
const
Map<T>
& m,
const
T& t) {
60
const
std::vector<T> tv(1, t);
61
return
map_count_idc
(m, tv)[0];
62
}
63
64
}
// namespace mam
65
}
// namespace line
66
67
#endif
// LINE_API_MAM_MAP_COUNT_IDC_H
error.h
The exception types the port throws.
map_count_mean.h
Mean of the counting process of a MAP at resolution t.
map_count_var.h
Variance of the counting process of a MAP at resolution t.
map_moment.h
Markovian arrival process descriptors: stationary vectors, rate, moments, autocorrelation and the ind...
line::mam
Definition
amap2_adjust_gamma.h:78
line::mam::map_count_var
std::vector< T > map_count_var(const Map< T > &m, const std::vector< T > &t)
Variance of the counting process of a MAP at resolution t.
Definition
map_count_var.h:74
line::mam::map_count_mean
std::vector< T > map_count_mean(const Map< T > &m, const std::vector< T > &t)
Mean of the counting process of a MAP at resolution t.
Definition
map_count_mean.h:44
line::mam::map_count_idc
std::vector< T > map_count_idc(const Map< T > &m, const std::vector< T > &t)
Index of dispersion for counts (IDC) of a MAP at resolution t.
Definition
map_count_idc.h:45
line
Definition
aoi_dist2ph.h:52
number.h
Number-type abstraction for the templated API port.
line::mam::Map
A MAP as the pair of matrices (D0, D1).
Definition
map_moment.h:53
line::num_traits
Definition
number.h:111
include
line
api
mam
map_count_idc.h
Generated by
1.18.0