Simulation Core Library

org.simulator.math
Class Relative_N_Metric

java.lang.Object
  extended by org.simulator.math.QualityMeasure
      extended by org.simulator.math.Relative_N_Metric
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
RelativeEuclideanDistance, RelativeManhattanDistance

public class Relative_N_Metric
extends QualityMeasure

Computes the relative distance of two vectors based on the N_Metric distance.

Since:
1.0
Version:
$Rev: 454 $
Author:
Roland Keller
See Also:
Serialized Form

Field Summary
protected  N_Metric metric
          The metric the relative distance is based on.
 
Fields inherited from class org.simulator.math.QualityMeasure
defaultValue, meanFunction
 
Constructor Summary
Relative_N_Metric()
          Default constructor
Relative_N_Metric(double root)
          Initialization with a certain n
Relative_N_Metric(N_Metric metric)
          Initialization with a given N_Metric
 
Method Summary
 double distance(MultiTable.Block.Column x, MultiTable.Block.Column expected, double defaultValue)
          Returns the distance of the two vectors x and y with the given root.
 void setDefaultValue(double value)
          Set the value to be returned by the distance function in cases, in which no distance can be computed.
 void setRoot(double root)
          Sets the root
 
Methods inherited from class org.simulator.math.QualityMeasure
distance, distance, getColumnDistances, getDefaultValue, getMeanFunction, setMeanFunction
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

metric

protected N_Metric metric
The metric the relative distance is based on.

Constructor Detail

Relative_N_Metric

public Relative_N_Metric()
Default constructor


Relative_N_Metric

public Relative_N_Metric(double root)
Initialization with a certain n

Parameters:
root -

Relative_N_Metric

public Relative_N_Metric(N_Metric metric)
Initialization with a given N_Metric

Parameters:
metric -
Method Detail

distance

public double distance(MultiTable.Block.Column x,
                       MultiTable.Block.Column expected,
                       double defaultValue)
Description copied from class: QualityMeasure
Returns the distance of the two vectors x and y with the given root. This may be the root in a formal way or a default value to be returned if the distance uses a non defined operation. If one array is longer than the other one additional values do not contribute to the distance. Double.NaN values are also ignored.

Specified by:
distance in class QualityMeasure
Parameters:
x - an array
expected - another array
defaultValue - The value to be returned in cases in which no distance computation is possible.
Returns:
The distance between the two arrays x and y.

setDefaultValue

public void setDefaultValue(double value)
Description copied from class: QualityMeasure
Set the value to be returned by the distance function in cases, in which no distance can be computed.

Overrides:
setDefaultValue in class QualityMeasure

setRoot

public void setRoot(double root)
Sets the root

Parameters:
root -

Generated at March 17 2014
Version 1.4 Revision 453