1 package org.opentrafficsim.kpi.sampling.indicator;
2
3 import org.djunits.value.vdouble.scalar.AbstractDoubleScalarRel;
4 import org.djunits.value.vdouble.scalar.DoubleScalarInterface;
5
6
7
8
9
10
11
12
13
14
15
16
17 public class PersistentStatistic<T extends AbstractDoubleScalarRel<?, T>> implements DoubleScalarInterface
18 {
19
20
21 private final Persistent<?, T, ?> persistent;
22
23
24
25
26
27 public PersistentStatistic(final Persistent<?, T, ?> persistent)
28 {
29 this.persistent = persistent.copy();
30 }
31
32
33
34
35
36 public ConfidenceInterval<T> getConfidenceInterval(final double alpha)
37 {
38 return this.persistent.getConfidenceInterval(alpha);
39 }
40
41
42
43
44
45
46 public ConfidenceInterval<T> getConfidenceInterval(final double alpha, final IntervalSide side)
47 {
48 return this.persistent.getConfidenceInterval(alpha, side);
49 }
50
51
52
53
54 public T getSum()
55 {
56 return this.persistent.getSum();
57 }
58
59
60
61
62 public T getMin()
63 {
64 return this.persistent.getMin();
65 }
66
67
68
69
70 public T getMax()
71 {
72 return this.persistent.getMax();
73 }
74
75
76
77
78 public T getMean()
79 {
80 return this.persistent.getMean();
81 }
82
83
84
85
86 public T getStDev()
87 {
88 return this.persistent.getStDev();
89 }
90
91
92
93
94 public double getVariance()
95 {
96 return this.persistent.getVariance();
97 }
98
99
100
101
102 public long getN()
103 {
104 return this.persistent.getN();
105 }
106
107
108 @Override
109 public double getSI()
110 {
111 return this.persistent.getMean().si;
112 }
113
114
115 @Override
116 public double getInUnit()
117 {
118 return this.persistent.getMean().si;
119 }
120
121 }