gov.sandia.cognition.learning.function.distance
Class IdentityDistanceMetric

java.lang.Object
  extended by gov.sandia.cognition.util.AbstractCloneableSerializable
      extended by gov.sandia.cognition.learning.function.distance.IdentityDistanceMetric
All Implemented Interfaces:
DivergenceFunction<Object,Object>, Metric<Object>, Semimetric<Object>, CloneableSerializable, Serializable, Cloneable

public class IdentityDistanceMetric
extends AbstractCloneableSerializable
implements Metric<Object>

A distance metric that is 0 if two objects are equal and 1 if they are not. Can be used with any object with a valid equals method.

Since:
3.3.3
Author:
Justin Basilico
See Also:
Serialized Form

Constructor Summary
IdentityDistanceMetric()
          Creates a new IdentityDistanceMetric.
 
Method Summary
 double evaluate(Object first, Object second)
          Evaluates the divergence between the two given objects.
 
Methods inherited from class gov.sandia.cognition.util.AbstractCloneableSerializable
clone
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface gov.sandia.cognition.util.CloneableSerializable
clone
 

Constructor Detail

IdentityDistanceMetric

public IdentityDistanceMetric()
Creates a new IdentityDistanceMetric.

Method Detail

evaluate

public double evaluate(Object first,
                       Object second)
Description copied from interface: DivergenceFunction
Evaluates the divergence between the two given objects.

Specified by:
evaluate in interface DivergenceFunction<Object,Object>
Parameters:
first - The first object.
second - The second object.
Returns:
The divergence between the objects.