All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.opentrafficsim.kpi.sampling.indicator.PersistentStatistic Maven / Gradle / Ivy

There is a newer version: 1.7.5
Show newest version
package org.opentrafficsim.kpi.sampling.indicator;

import org.djunits.unit.Unit;
import org.djunits.value.vdouble.scalar.base.AbstractDoubleScalarRel;

/**
 * 

* Copyright (c) 2013-2023 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
* BSD-style license. See OpenTrafficSim License. *

* @author Alexander Verbraeck * @author Peter Knoppers * @author Wouter Schakel * @param the unit type * @param type of the value */ public class PersistentStatistic, T extends AbstractDoubleScalarRel> { /** Wrapped persistent. */ private final Persistent persistent; /** * Constructor. * @param persistent Persistent<?,T,?>; the persistent statistic that gathers the data */ public PersistentStatistic(final Persistent persistent) { this.persistent = persistent.copy(); } /** * @param alpha double; confidence level * @return both-side confidence interval */ public ConfidenceInterval getConfidenceInterval(final double alpha) { return this.persistent.getConfidenceInterval(alpha); } /** * @param alpha double; confidence level * @param side IntervalSide; side of confidence interval * @return confidence interval */ public ConfidenceInterval getConfidenceInterval(final double alpha, final IntervalSide side) { return this.persistent.getConfidenceInterval(alpha, side); } /** * @return sum. */ public T getSum() { return this.persistent.getSum(); } /** * @return min. */ public T getMin() { return this.persistent.getMin(); } /** * @return max. */ public T getMax() { return this.persistent.getMax(); } /** * @return mean. */ public T getMean() { return this.persistent.getMean(); } /** * @return stDev. */ public T getStDev() { return this.persistent.getStDev(); } /** * @return variance. */ public double getVariance() { return this.persistent.getVariance(); } /** * @return n. */ public long getN() { return this.persistent.getN(); } /** {@inheritDoc} */ @Override public final String toString() { return "PersistentStatistic [persistent=" + this.persistent + "]"; } }