public class SamplingMedianDistanceThresholdSelectionStrategy<P,E extends P> extends MedianDistanceThresholdSelectionStrategy<P,E> implements ThresholdSelectionStrategy<P,E>
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_NUMBER_OF_SAMPLES |
Constructor and Description |
---|
SamplingMedianDistanceThresholdSelectionStrategy(int numberOfSamples)
Constructs a threshold selector that uses up to the given number of samples from a list of points to choose a
median distance.
|
Modifier and Type | Method and Description |
---|---|
double |
selectThreshold(List<E> points,
P origin,
DistanceFunction<P> distanceFunction)
Returns the median distance of a subset of the given points from the given origin.
|
public static final int DEFAULT_NUMBER_OF_SAMPLES
public SamplingMedianDistanceThresholdSelectionStrategy(int numberOfSamples)
numberOfSamples
- the maximum number of samples to use when choosing a median distancepublic double selectThreshold(List<E> points, P origin, DistanceFunction<P> distanceFunction)
selectThreshold
in interface ThresholdSelectionStrategy<P,E extends P>
selectThreshold
in class MedianDistanceThresholdSelectionStrategy<P,E extends P>
points
- the list of points from which a median distance will be chosenorigin
- the point from which distances to other points will be calculateddistanceFunction
- the function to be used to calculate the distance between the origin and other pointsCopyright © 2015-2016. All Rights Reserved.