de.lmu.ifi.dbs.elki.algorithm
Class DistanceBasedAlgorithm<O extends DatabaseObject,D extends Distance<D>,R extends Result>
java.lang.Object
de.lmu.ifi.dbs.elki.logging.AbstractLoggable
de.lmu.ifi.dbs.elki.utilities.optionhandling.AbstractParameterizable
de.lmu.ifi.dbs.elki.algorithm.AbstractAlgorithm<O,R>
de.lmu.ifi.dbs.elki.algorithm.DistanceBasedAlgorithm<O,D,R>
- Type Parameters:
O
- the type of DatabaseObjects handled by this AlgorithmD
- the type of Distance used by this AlgorithmR
- the type of result to retrieve from this Algorithm
- All Implemented Interfaces:
- Algorithm<O,R>, Parameterizable
- Direct Known Subclasses:
- ABOD, DBSCAN, DeLiClu, DependencyDerivator, DistanceStatisticsWithClasses, EvaluateRankingQuality, KMeans, KNNDistanceOrder, KNNJoin, LOCI, LOF, MaterializeDistances, OPTICS, RankingQualityHistogram, SLINK
public abstract class DistanceBasedAlgorithm<O extends DatabaseObject,D extends Distance<D>,R extends Result>
- extends AbstractAlgorithm<O,R>
Provides an abstract algorithm already setting the distance function.
- Author:
- Arthur Zimek
Methods inherited from class de.lmu.ifi.dbs.elki.utilities.optionhandling.AbstractParameterizable |
addOption, addParameterizable, addParameterizable, checkGlobalParameterConstraints, collectOptions, getAttributeSettings, getParameters, rememberParametersExcept, removeOption, removeParameterizable, shortDescription |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DISTANCE_FUNCTION_ID
public static final OptionID DISTANCE_FUNCTION_ID
- OptionID for
DISTANCE_FUNCTION_PARAM
DISTANCE_FUNCTION_PARAM
protected final ClassParameter<DistanceFunction<O extends DatabaseObject,D extends Distance<D>>> DISTANCE_FUNCTION_PARAM
- Parameter to specify the distance function to determine the distance between database objects,
must extend
DistanceFunction
.
Key: -algorithm.distancefunction
Default value: EuclideanDistanceFunction
distanceFunction
private DistanceFunction<O extends DatabaseObject,D extends Distance<D>> distanceFunction
- Holds the instance of the distance function specified by
DISTANCE_FUNCTION_PARAM
.
DistanceBasedAlgorithm
protected DistanceBasedAlgorithm()
- Adds parameter
DISTANCE_FUNCTION_PARAM
to the option handler additionally to parameters of super class.
setParameters
public List<String> setParameters(List<String> args)
throws ParameterException
- Calls the super method
and instantiates
distanceFunction
according to the value of parameter
DISTANCE_FUNCTION_PARAM
.
The remaining parameters are passed to the distanceFunction
.
- Specified by:
setParameters
in interface Parameterizable
- Overrides:
setParameters
in class AbstractAlgorithm<O extends DatabaseObject,R extends Result>
- Parameters:
args
- parameters to set the attributes accordingly to
- Returns:
- a list containing the unused parameters
- Throws:
ParameterException
- in case of wrong parameter-setting
getDistanceFunction
public DistanceFunction<O,D> getDistanceFunction()
- Returns the distanceFunction.
- Returns:
- the distanceFunction