|
|
|||||||||||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.lmu.ifi.dbs.elki.logging.AbstractLoggable
de.lmu.ifi.dbs.elki.utilities.optionhandling.AbstractParameterizable
de.lmu.ifi.dbs.elki.distance.AbstractMeasurementFunction<O,D>
de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractDistanceFunction<M,D>
de.lmu.ifi.dbs.elki.distance.distancefunction.RepresentationSelectingDistanceFunction<O,M,D>
M
- the type of MultiRepresentedObject to compute the distances in betweenO
- the type of represented DatabaseObjectsD
- the type of Distance usedpublic class RepresentationSelectingDistanceFunction<O extends DatabaseObject,M extends MultiRepresentedObject<O>,D extends Distance<D>>
Distance function for multirepresented objects that selects one representation and computes the distances only within the selected representation.
Field Summary | |
---|---|
private int |
currentRepresentationIndex
The index of the current representation. |
static String |
DEFAULT_DISTANCE_FUNCTION
The default distance function. |
private DistanceFunction<O,D> |
defaultDistanceFunction
The default distance function. |
static OptionID |
DISTANCE_FUNCTIONS_ID
OptionID for DISTANCE_FUNCTIONS_PARAM |
private ClassListParameter<DistanceFunction<O,D>> |
DISTANCE_FUNCTIONS_PARAM
Parameter to specify the distance functions |
private List<DistanceFunction<O,D>> |
distanceFunctions
The list of distance functions for each representation. |
static Pattern |
SPLIT
A pattern defining a comma. |
Fields inherited from class de.lmu.ifi.dbs.elki.distance.AbstractMeasurementFunction |
---|
INFINITY_PATTERN |
Fields inherited from class de.lmu.ifi.dbs.elki.utilities.optionhandling.AbstractParameterizable |
---|
optionHandler |
Fields inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable |
---|
debug, logger |
Constructor Summary | |
---|---|
RepresentationSelectingDistanceFunction()
Provides a Distance function for multirepresented objects that selects one representation and computes the distances only within the selected representation. |
Method Summary | |
---|---|
D |
distance(M o1,
M o2)
Computes the distance between two given DatabaseObjects according to this distance function. |
private DistanceFunction<O,D> |
getDistanceFunctionForCurrentRepresentation()
Returns the distance function for the currently selected representation. |
D |
infiniteDistance()
Provides an infinite distance. |
D |
nullDistance()
Provides a null distance. |
void |
setCurrentRepresentationIndex(int index)
Sets the currently selected representation for which the distances will be computed. |
List<String> |
setParameters(List<String> args)
Grabs all specified options from the option handler. |
String |
shortDescription()
Returns the required input pattern. |
D |
undefinedDistance()
Provides an undefined distance. |
D |
valueOf(String pattern)
Provides a measurement suitable to this measurement function based on the given pattern. |
Methods inherited from class de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractDistanceFunction |
---|
distance, distance, isInfiniteDistance, isNullDistance, isUndefinedDistance |
Methods inherited from class de.lmu.ifi.dbs.elki.distance.AbstractMeasurementFunction |
---|
getDatabase, matches, requiredInputPattern, setDatabase, setRequiredInputPattern |
Methods inherited from class de.lmu.ifi.dbs.elki.utilities.optionhandling.AbstractParameterizable |
---|
addOption, addParameterizable, addParameterizable, checkGlobalParameterConstraints, collectOptions, getAttributeSettings, getParameters, rememberParametersExcept, removeOption, removeParameterizable |
Methods inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable |
---|
debugFine, debugFiner, debugFinest, exception, progress, verbose, warning |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface de.lmu.ifi.dbs.elki.distance.MeasurementFunction |
---|
requiredInputPattern, setDatabase |
Methods inherited from interface de.lmu.ifi.dbs.elki.utilities.optionhandling.Parameterizable |
---|
checkGlobalParameterConstraints, collectOptions, getParameters |
Field Detail |
---|
public static final Pattern SPLIT
public static final String DEFAULT_DISTANCE_FUNCTION
public static final OptionID DISTANCE_FUNCTIONS_ID
DISTANCE_FUNCTIONS_PARAM
private final ClassListParameter<DistanceFunction<O extends DatabaseObject,D extends Distance<D>>> DISTANCE_FUNCTIONS_PARAM
private int currentRepresentationIndex
private List<DistanceFunction<O extends DatabaseObject,D extends Distance<D>>> distanceFunctions
private DistanceFunction<O extends DatabaseObject,D extends Distance<D>> defaultDistanceFunction
Constructor Detail |
---|
public RepresentationSelectingDistanceFunction()
Method Detail |
---|
public void setCurrentRepresentationIndex(int index)
index
- the index of the representation to be selectedpublic D valueOf(String pattern) throws IllegalArgumentException
MeasurementFunction
pattern
- a pattern defining a similarity suitable to this
measurement function
IllegalArgumentException
- if the given pattern is not compatible with the requirements
of this measurement functionpublic D infiniteDistance()
MeasurementFunction
public D nullDistance()
MeasurementFunction
public D undefinedDistance()
MeasurementFunction
public D distance(M o1, M o2)
DistanceFunction
o1
- first DatabaseObjecto2
- second DatabaseObject
public String shortDescription()
AbstractMeasurementFunction
shortDescription
in interface Parameterizable
shortDescription
in class AbstractMeasurementFunction<M extends MultiRepresentedObject<O>,D extends Distance<D>>
public List<String> setParameters(List<String> args) throws ParameterException
AbstractParameterizable
{ ListremainingParameters = super.setParameters(args); // set parameters for your class // for example like this: if(isSet(MY_PARAM_VALUE_PARAM)) { myParamValue = getParameterValue(MY_PARAM_VALUE_PARAM); } . . . return remainingParameters; // or in case of attributes requesting parameters themselves // return parameterizableAttribbute.setParameters(remainingParameters); }
setParameters
in interface Parameterizable
setParameters
in class AbstractParameterizable
args
- parameters to set the attributes accordingly to
ParameterException
- in case of wrong parameter-settingprivate DistanceFunction<O,D> getDistanceFunctionForCurrentRepresentation()
|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |