reasoner
Class Distance

java.lang.Object
  extended by reasoner.Role
      extended by reasoner.Distance
All Implemented Interfaces:
FuzzySet

public class Distance
extends Role

This class represents the Role "distance"

Author:
marco furlan

Constructor Summary
Distance(KnowledgeBase kb)
          Constructs a new empty Distance
Distance(java.lang.String name, KnowledgeBase kb)
          Constructs a new empty Distance
Distance(java.util.TreeMap<Individual,java.lang.Double> r, KnowledgeBase kb)
          Constructs a new Distance with a given Role map
 
Method Summary
 double getValue(double x1, double x2, double y1, double y2)
          Gets a double value as euclidean distance between two points, given cartesian coordinates
 java.lang.String toString()
          A String representation for this Role
 
Methods inherited from class reasoner.Role
add, card, card, containsInd, get, getInds, getKb, getLambda, getName, getR, intersection, print, setKb, setName, setR, totalLambda, totalLambda
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Distance

public Distance(java.lang.String name,
                KnowledgeBase kb)
Constructs a new empty Distance

Parameters:
name - the name
kb - the KnowledgeBase

Distance

public Distance(java.util.TreeMap<Individual,java.lang.Double> r,
                KnowledgeBase kb)
Constructs a new Distance with a given Role map

Parameters:
r - the Role map
kb - the KnowledgeBase

Distance

public Distance(KnowledgeBase kb)
Constructs a new empty Distance

Parameters:
kb - the KnowledgeBase
Method Detail

getValue

public double getValue(double x1,
                       double x2,
                       double y1,
                       double y2)
Gets a double value as euclidean distance between two points, given cartesian coordinates

Parameters:
x1 - the x coordinate for first point
x2 - the x coordinate for second point
y1 - the y coordinate for first point
y2 - the y coordiante for second point
Returns:
the euclidean distance

toString

public java.lang.String toString()
Description copied from class: Role
A String representation for this Role

Overrides:
toString in class Role
Returns:
the String