es.upv.dsic.gti_ia.argAgents
Class Metrics

java.lang.Object
  extended by es.upv.dsic.gti_ia.argAgents.Metrics

public class Metrics
extends Object

This class contains metrics that are used in the CBR algorithm to measure the similarity between case attributes, base on their distance.


Constructor Summary
Metrics()
           
 
Method Summary
static int dist(Date a, Date b)
          This method calculates the distance between two Date Objects.
static float dist(float a, float b)
          This method calculates the distance between two floats.
static int dist(int a, int b)
          This method calculates the distance between two integers.
static int dist(String sp, String tp)
          This method calculates the edition distance between two Strings.
static float doDist(String a, String b)
          This method decide about which is the data type of the attributes that are contained in the Strings that will be compared, and return the distance between them.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Metrics

public Metrics()
Method Detail

doDist

public static float doDist(String a,
                           String b)
This method decide about which is the data type of the attributes that are contained in the Strings that will be compared, and return the distance between them.

Parameters:
a - an String that contains an attribute.
b - an String that contains an attribute.

dist

public static float dist(float a,
                         float b)
This method calculates the distance between two floats.

Parameters:
a - a float data
b - a float data
Returns:
the distance between two floats.

dist

public static int dist(int a,
                       int b)
This method calculates the distance between two integers.

Parameters:
a - an integer data
b - an integer data
Returns:
the distance between two integers.

dist

public static int dist(Date a,
                       Date b)
This method calculates the distance between two Date Objects.

Parameters:
a - a Date Object
b - a Date Object
Returns:
the distance between two Date Objects.

dist

public static int dist(String sp,
                       String tp)
This method calculates the edition distance between two Strings.

Parameters:
sp - a String Object.
tp - a String Object.
Returns:
the edition distance between two Strings.


Copyright © 2012 GTI-IA. All Rights Reserved.