reasoner
Class ConcreteConcept

java.lang.Object
  extended by reasoner.Trapezoid
      extended by reasoner.ConcreteConcept
All Implemented Interfaces:
FuzzySet

public class ConcreteConcept
extends Trapezoid

This class represents a Concrete Concept, having a Trapezoid as membership function and contained in a KnowledgeBase

Author:
marco furlan

Field Summary
protected  KnowledgeBase kb
          the KnowledgeBase
private  java.lang.String name
          the name
private  double NOW
          the NOW constant
private  double SELF
          the SELF constant
 
Fields inherited from class reasoner.Trapezoid
formatter, maxval, meaning, minval, patternAround, patternBetween
 
Constructor Summary
ConcreteConcept(java.lang.Double a1, java.lang.Double b1, java.lang.Double c1, java.lang.Double d1, java.lang.Double max, KnowledgeBase kb)
          Constructor by vertices, max and KnowledgeBase
ConcreteConcept(java.lang.String name, java.lang.Double a1, java.lang.Double b1, java.lang.Double c1, java.lang.Double d1, java.lang.Double max, KnowledgeBase kb)
          Constructor by name, vertices, max and KnowledgeBase
ConcreteConcept(java.lang.String name, KnowledgeBase kb)
          Constructor by name and KnowledgeBase
 
Method Summary
 ConcreteConcept diff(ConcreteConcept t)
          FuzzySet difference between this ConcreteConcept and a second one
 KnowledgeBase getKb()
           
 double getMaxval()
           
 double getMinval()
           
 java.lang.String getName()
           
 double getNOW()
           
 double getSELF()
           
 ConcreteConcept intersection(FuzzySet f)
          FuzzySet intersection between this ConcreteConcept and a generic FuzzySet
 void print()
          Prints a String representation for this Concrete Concept
 void print(java.util.TreeSet<java.lang.Double> lambda2)
          Prints Lambda, the alpha level set for membership values, as a TreeSet
 ConcreteConcept prod(ConcreteConcept t)
          FuzzySet product between this ConcreteConcept and a second one
 ConcreteConcept ratio(ConcreteConcept t)
          FuzzySet ratio between this ConcreteConcept and a second one.
 void setKb(KnowledgeBase kb)
           
 void setMaxval(double maxval)
           
 void setMinval(double minval)
           
 void setName(java.lang.String name1)
           
 void setNOW(double now)
           
 void setSELF(double self)
           
protected  void setVertices(java.lang.Double a1, java.lang.Double b1, java.lang.Double c1, java.lang.Double d1, java.lang.Double max)
          Sets vertices and max value.
protected  void setVerticesAndMin(java.lang.Double a1, java.lang.Double b1, java.lang.Double c1, java.lang.Double d1, java.lang.Double max, java.lang.Double min)
          Sets vertices, max and min value.
 ConcreteConcept sum(ConcreteConcept t)
          FuzzySet sum between this ConcreteConcept and a second one
 Concept toConcept()
          Converts this ConcreteConcept in a Concept
 java.lang.String toString()
          String representation for this Concrete Concept
 ConcreteConcept union(FuzzySet f)
          FuzzySet union between this ConcreteConcept and a generic FuzzySet
 
Methods inherited from class reasoner.Trapezoid
card, diff, fixVertices, geta, getAroundValue, getb, getBetweenValue, getc, getd, getKeys, getLambda, getMeaning, getVertValues, prod, qvalue, ratio, seta, setb, setc, setd, setMeaning, setMeaning, setVertices, sum
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

name

private java.lang.String name
the name


kb

protected KnowledgeBase kb
the KnowledgeBase


SELF

private double SELF
the SELF constant


NOW

private double NOW
the NOW constant

Constructor Detail

ConcreteConcept

public ConcreteConcept(java.lang.Double a1,
                       java.lang.Double b1,
                       java.lang.Double c1,
                       java.lang.Double d1,
                       java.lang.Double max,
                       KnowledgeBase kb)
Constructor by vertices, max and KnowledgeBase

Parameters:
a1 - first vertice
b1 - second vertice
c1 - third vertice
d1 - forth vertice
max - the max value
kb - the KnowledgeBase

ConcreteConcept

public ConcreteConcept(java.lang.String name,
                       java.lang.Double a1,
                       java.lang.Double b1,
                       java.lang.Double c1,
                       java.lang.Double d1,
                       java.lang.Double max,
                       KnowledgeBase kb)
Constructor by name, vertices, max and KnowledgeBase

Parameters:
name - the name
a1 - first vertice
b1 - second vertice
c1 - third vertice
d1 - forth vertice
max - the max value
kb - the KnowledgeBase

ConcreteConcept

public ConcreteConcept(java.lang.String name,
                       KnowledgeBase kb)
Constructor by name and KnowledgeBase

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

toConcept

public Concept toConcept()
Converts this ConcreteConcept in a Concept

Returns:
a Concept with same name and kb, empty if it doesn't already exists in the kb

setName

public void setName(java.lang.String name1)
Overrides:
setName in class Trapezoid
Parameters:
name1 - the name

getName

public java.lang.String getName()
Overrides:
getName in class Trapezoid
Returns:
the name

setVertices

protected void setVertices(java.lang.Double a1,
                           java.lang.Double b1,
                           java.lang.Double c1,
                           java.lang.Double d1,
                           java.lang.Double max)
Sets vertices and max value.

Parameters:
a1 - first vertice
b1 - second vertice
c1 - third vertice
d1 - forth vertice
max - the max value

setVerticesAndMin

protected void setVerticesAndMin(java.lang.Double a1,
                                 java.lang.Double b1,
                                 java.lang.Double c1,
                                 java.lang.Double d1,
                                 java.lang.Double max,
                                 java.lang.Double min)
Sets vertices, max and min value.

Parameters:
a1 - first vertice
b1 - second vertice
c1 - third vertice
d1 - forth vertice
max - the max value
min - the min value

toString

public java.lang.String toString()
String representation for this Concrete Concept

Overrides:
toString in class Trapezoid
Returns:
the String representation
See Also:
Trapezoid.toString()

print

public void print()
Prints a String representation for this Concrete Concept

Overrides:
print in class Trapezoid
See Also:
Trapezoid.print()

sum

public ConcreteConcept sum(ConcreteConcept t)
FuzzySet sum between this ConcreteConcept and a second one

Parameters:
t - the second ConcreteConcept
Returns:
the sum

diff

public ConcreteConcept diff(ConcreteConcept t)
FuzzySet difference between this ConcreteConcept and a second one

Parameters:
t - the second ConcreteConcept
Returns:
the difference

prod

public ConcreteConcept prod(ConcreteConcept t)
FuzzySet product between this ConcreteConcept and a second one

Parameters:
t - the second ConcreteConcept
Returns:
the product

ratio

public ConcreteConcept ratio(ConcreteConcept t)
FuzzySet ratio between this ConcreteConcept and a second one. Possible for divisor non containing zero only!

Parameters:
t - the second ConcreteConcept
Returns:
the ratio

intersection

public ConcreteConcept intersection(FuzzySet f)
FuzzySet intersection between this ConcreteConcept and a generic FuzzySet

Overrides:
intersection in class Trapezoid
Parameters:
f - the FuzzySet
Returns:
the intersection

union

public ConcreteConcept union(FuzzySet f)
FuzzySet union between this ConcreteConcept and a generic FuzzySet

Overrides:
union in class Trapezoid
Parameters:
f - the FuzzySet
Returns:
the union

print

public void print(java.util.TreeSet<java.lang.Double> lambda2)
Prints Lambda, the alpha level set for membership values, as a TreeSet

Parameters:
lambda2 - the Lambda

getKb

public KnowledgeBase getKb()
Returns:
the kb

setKb

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

getMaxval

public double getMaxval()
Overrides:
getMaxval in class Trapezoid
Returns:
the maxval

setMaxval

public void setMaxval(double maxval)
Overrides:
setMaxval in class Trapezoid
Parameters:
maxval - the maxval to set

getMinval

public double getMinval()
Overrides:
getMinval in class Trapezoid
Returns:
the minval

setMinval

public void setMinval(double minval)
Overrides:
setMinval in class Trapezoid
Parameters:
minval - the minval to set

getNOW

public double getNOW()
Returns:
the NOW

setNOW

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

getSELF

public double getSELF()
Returns:
the SELF

setSELF

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