reasoner
Class Individual

java.lang.Object
  extended by reasoner.Individual
All Implemented Interfaces:
java.lang.Comparable<Individual>
Direct Known Subclasses:
DynamicInd, StaticInd

public abstract class Individual
extends java.lang.Object
implements java.lang.Comparable<Individual>

This abstract class represents the generic Individuals. Every Individual has a name and a time and is contained in a KnowledgeBase. Subclass are StaticInd and DynamicInd only.

Author:
marco furlan

Field Summary
protected  KnowledgeBase kb
           
protected  java.lang.String name
           
protected static double NOW
           
protected static double SELF
           
protected  double time
           
 
Constructor Summary
Individual(java.lang.String name, KnowledgeBase kb)
          Constructor for the generic Individual, by name and KnowledgeBase
 
Method Summary
 int compareTo(Individual i)
          Compares by name this Individual with a given one
abstract  double eval(Concept c)
          Evaluates the membership value for this Individual in the given Concept
 KnowledgeBase getKb()
           
 java.lang.String getName()
           
 double getNOW()
           
 double getSELF()
           
 double getTime()
          If this individual does'nt belong to any UniversalLine, it's time is NOW; otherwise, it's time is set on creation
 void setKb(KnowledgeBase kb)
           
 void setName(java.lang.String name)
           
private  void setNOW(double now)
           
private  void setSELF(double self)
           
 void setTime(double time)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

protected java.lang.String name

time

protected double time

SELF

protected static double SELF

NOW

protected static double NOW

kb

protected KnowledgeBase kb
Constructor Detail

Individual

public Individual(java.lang.String name,
                  KnowledgeBase kb)
Constructor for the generic Individual, by name and KnowledgeBase

Parameters:
name - the name
kb - the KnowledgeBase
Method Detail

eval

public abstract double eval(Concept c)
Evaluates the membership value for this Individual in the given Concept

Parameters:
c - the Concept

getName

public java.lang.String getName()
Returns:
the name

setName

public void setName(java.lang.String name)
Parameters:
name - the name to set

getTime

public double getTime()
If this individual does'nt belong to any UniversalLine, it's time is NOW; otherwise, it's time is set on creation

Returns:
the time

setTime

public void setTime(double time)
Parameters:
time - the time to set

compareTo

public int compareTo(Individual i)
Compares by name this Individual with a given one

Specified by:
compareTo in interface java.lang.Comparable<Individual>
Parameters:
i - the given Individual
Returns:
the value 0 if this Individual name is lexicographical equal to the argument Individual name; a value less than 0 if this Individual name is lexicographically less than the argument Individual name; and a value greater than 0 if this Individual name is lexicographically greater than the argument Individual name.

getKb

public KnowledgeBase getKb()
Returns:
the KnowledgeBase kb

setKb

public void setKb(KnowledgeBase kb)
Parameters:
kb - the KnowledgeBase to set

getSELF

public double getSELF()
Returns:
the constant SELF, set by the KnowledgeBase

setSELF

private void setSELF(double self)
Parameters:
self - the constant SELF to set

getNOW

public double getNOW()
Returns:
the constant NOW, set by the KnowledgeBase

setNOW

private void setNOW(double now)
Parameters:
now - the constant NOW to set