1 package org.djutils.stats.summarizers.quantileaccumulator; 2 3 import org.djutils.stats.summarizers.Tally; 4 5 /** 6 * Interface for quantile accumulator. <br> 7 * @author <a href="https://www.tudelft.nl/staff/p.knoppers/">Peter Knoppers</a> 8 */ 9 public interface QuantileAccumulator 10 { 11 /** 12 * Ingest one value with weight 1. Should be called only from the Tally object and AFTER processing the value in the tally. 13 * @param value double; the value 14 * @return double; the ingested value 15 * @throws IllegalArgumentException when the ingested value is NaN 16 */ 17 double ingest(double value); 18 19 /** 20 * Compute (or approximate) the value that corresponds to the given fraction (percentile). 21 * @param tally Tally; the tally object that accumulates mean, minimum, maximum, count, etc. 22 * @param probability double; value between 0.0 and 1.0 (both inclusive) 23 * @return double; the computed or approximated quantile value 24 * @throws IllegalArgumentException when the probability is less than 0 or larger than 1 25 * @throws NullPointerException when tally is null 26 */ 27 double getQuantile(Tally tally, double probability); 28 29 /** 30 * Reset (clear all accumulated information). 31 */ 32 void initialize(); 33 34 }