public class UniformReservoir extends java.lang.Object implements Reservoir
long
s. Uses Vitter's Algorithm R to produce a
statistically representative sample.Constructor and Description |
---|
UniformReservoir()
Creates a new
UniformReservoir of 1028 elements, which offers a 99.9% confidence level
with a 5% margin of error assuming a normal distribution. |
UniformReservoir(int size)
Creates a new
UniformReservoir . |
Modifier and Type | Method and Description |
---|---|
Snapshot |
getSnapshot()
Returns a snapshot of the reservoir's values.
|
int |
size()
Returns the number of values recorded.
|
void |
update(long value)
Adds a new recorded value to the reservoir.
|
public UniformReservoir()
UniformReservoir
of 1028 elements, which offers a 99.9% confidence level
with a 5% margin of error assuming a normal distribution.public UniformReservoir(int size)
UniformReservoir
.size
- the number of samples to keep in the sampling reservoirpublic int size()
Reservoir
public void update(long value)
Reservoir
public Snapshot getSnapshot()
Reservoir
getSnapshot
in interface Reservoir
"Copyright © 2010 - 2020 Adobe Systems Incorporated. All Rights Reserved"