|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectreasoner.Role
public class Role
This class represents a role or, more exactly, the role projection over some individual, as a fuzzy set
Field Summary | |
---|---|
private KnowledgeBase |
kb
The KnowledgeBase |
private java.lang.String |
name
The role name |
private java.util.Map<Individual,java.lang.Double> |
r
The map between Individuals and membership values |
Constructor Summary | |
---|---|
Role(KnowledgeBase kb)
Constructs an empty Role |
|
Role(java.lang.String name,
KnowledgeBase kb)
Constructs this Role by name and KnowledgeBase |
|
Role(java.util.TreeMap<Individual,java.lang.Double> r,
KnowledgeBase kb)
Constructs this Role by map and KnowledgeBase |
Method Summary | |
---|---|
Role |
add(Individual s,
java.lang.Double d)
Adds a [Individual, value] couple to this Role |
java.lang.Integer |
card(java.lang.Double a)
The cardinality of this Role at an alpha level |
java.lang.Integer |
card(java.lang.Double alpha,
java.lang.String mode)
Gives the integer cardinality at the given alpha level. |
boolean |
containsInd(Individual key)
Tests the given Individual existence in this Role |
double |
get(Individual ind)
Gets membership value for a given Individual |
java.util.Set<Individual> |
getInds()
Gets this Role set of Individuals |
KnowledgeBase |
getKb()
|
java.util.TreeSet<java.lang.Double> |
getLambda()
Gets the set lambda of alpha-values belonging to this Role |
java.lang.String |
getName()
|
java.util.Map<Individual,java.lang.Double> |
getR()
|
Role |
intersection(Concept c)
Intersection between this Role and a Concept |
void |
print()
Prints a string representation for this Role |
void |
setKb(KnowledgeBase kb)
|
void |
setName(java.lang.String name)
|
void |
setR(java.util.Map<Individual,java.lang.Double> r)
|
java.lang.String |
toString()
A String representation for this Role |
java.util.TreeSet<java.lang.Double> |
totalLambda(Concept c)
Gets the union set of alpha-values belonging to this Role and to a Concept |
java.util.TreeSet<java.lang.Double> |
totalLambda(Role c)
Gets the union set of alpha-values belonging to this Role and to a second Role |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private java.util.Map<Individual,java.lang.Double> r
private java.lang.String name
private KnowledgeBase kb
Constructor Detail |
---|
public Role(java.lang.String name, KnowledgeBase kb)
name
- the namekb
- the KnowledgeBasepublic Role(java.util.TreeMap<Individual,java.lang.Double> r, KnowledgeBase kb)
r
- a map containing Individuals and membership valueskb
- the KnowledgeBasepublic Role(KnowledgeBase kb)
kb
- the KnowledgeBaseMethod Detail |
---|
public java.lang.String getName()
public void setName(java.lang.String name)
name
- the name to setpublic Role add(Individual s, java.lang.Double d)
s
- the Individuald
- the membership value
public java.lang.Integer card(java.lang.Double a)
a
- the alpha value
public java.util.TreeSet<java.lang.Double> totalLambda(Concept c)
c
- the Concept
public java.util.TreeSet<java.lang.Double> totalLambda(Role c)
c
- the second Role
public java.util.TreeSet<java.lang.Double> getLambda()
getLambda
in interface FuzzySet
public java.util.Set<Individual> getInds()
public boolean containsInd(Individual key)
key
- the Individual
true
if this Role contains key, false
otherwisepublic Role intersection(Concept c)
c
- the Concept
public double get(Individual ind)
ind
- the Individual
public void print()
public KnowledgeBase getKb()
public void setKb(KnowledgeBase kb)
kb
- the kb to setpublic java.util.Map<Individual,java.lang.Double> getR()
public void setR(java.util.Map<Individual,java.lang.Double> r)
r
- the r to setpublic java.lang.String toString()
toString
in class java.lang.Object
public java.lang.Integer card(java.lang.Double alpha, java.lang.String mode)
FuzzySet
card
in interface FuzzySet
alpha
- the given alpha levelmode
- the selecting String
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |