|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjcreek.reasoning.EntityComparison
An abstract class for comparison of two entities.
The similarity of two entities is measured by a strength. The strength is only computed if the comparison is comparable and the depth is above the threshold depth for comparison. The definition of comparable depends on whether the comparison is between entities or relations. Implementations of this class must therefore include a method for determining whether the comparison is comparable or not. They must include algorithms on how to compute the comparison strength.
Field Summary | |
static int |
ACTIVATED_STATUS
The status of the comparison after activation |
protected double |
activationStrength
The activation strength |
static int |
EXPLAINED_STATUS
The status of the comparison after explanation |
protected double |
explanationStrength
The explanation strength |
static int |
INITIAL_STATUS
The status of the comparison before activation |
protected static double |
INITIAL_STRENGTH
The initial strength of the comparison |
protected Entity |
origin
The origin concept |
protected Entity |
target
The target concept |
Constructor Summary | |
protected |
EntityComparison()
|
|
EntityComparison(Entity origin,
Entity target)
Constructs a comparison between the origin concept and the target concept with given depth. |
Method Summary | |
void |
activate()
Activates the comparison between the origin and target concepts. |
static double |
addParallell(double s1,
double s2)
Formula used for calculate the strength of two explanations when they are parallell, i.e. either can be used. |
static double |
addSerial(double s1,
double s2)
Formula used for calculate the strength of two explanations when they are serial, i.e. both must apply. |
static boolean |
checkIsComparable(Entity e1,
Entity e2)
Tests if the two given entities are comparable. |
int |
compareTo(java.lang.Object a)
|
static EntityComparison |
createComparison(Entity origin,
Entity target)
|
void |
explain()
Explains the comparison between the origin and target concepts. |
double |
getActivationStrength()
Returns the activation strength of the comparison. |
double |
getExplanationStrength()
Returns the explanation strength of the comparison. |
KnowledgeModel |
getKnowledgeModel()
Returns the knowledge model of the origin concept. |
Entity |
getOrigin()
Returns the origin concept of the comparison. |
int |
getPercentageStrength()
Returns the strength of the comparison as a percentage int. |
int |
getStatus()
Returns the status of the comparison. |
java.lang.String |
getStatusText()
Returns the status of the comparison as a text string. |
double |
getStrength()
Returns the strength of the comparison |
Entity |
getTarget()
Returns the target concept of the comparison. |
boolean |
isActivated()
Tests whether the comparison is activated. |
boolean |
isComparable()
Tests if the entities in the comparison is comparable. |
static boolean |
isComparable(Entity e1,
Entity e2)
|
boolean |
isCompletelyMatched()
Tests whether the comparison is completely matched. |
boolean |
isExplained()
Tests whether the comparison is explained. |
boolean |
isExplainMatched()
Tests whether the comparison is explained matched. |
boolean |
isPartlyMatched()
Tests whether the comparison is partly matched. |
boolean |
isUnmatched()
Tests whether the comparison is unmatched. |
void |
reset()
Resets the activation/explanation. |
java.lang.String |
shortExplanation()
Gives a short textual representation (a sentence or so) describing the comparison. |
java.lang.String |
toString()
Returns the string representation of the comparison |
SubModel |
toSubModel()
Returns a submodel of the entities compared. |
void |
update()
|
protected abstract double |
updateActivationStrength()
Computes the activation strenght of the comparison. |
protected abstract double |
updateExplanationStrength()
Updates the explanation strenght of the comparison. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int INITIAL_STATUS
public static final int ACTIVATED_STATUS
public static final int EXPLAINED_STATUS
protected static final double INITIAL_STRENGTH
protected Entity origin
protected Entity target
protected double activationStrength
protected double explanationStrength
Constructor Detail |
public EntityComparison(Entity origin, Entity target)
origin
- the concept to compare fromtarget
- the concept to compare toprotected EntityComparison()
Method Detail |
protected abstract double updateActivationStrength()
protected abstract double updateExplanationStrength()
public boolean isComparable()
public static boolean checkIsComparable(Entity e1, Entity e2)
public static boolean isComparable(Entity e1, Entity e2)
public void reset()
public void update()
public void activate()
isComparable()
public boolean isActivated()
public void explain()
isComparable()
public boolean isExplained()
public KnowledgeModel getKnowledgeModel()
public Entity getOrigin()
public Entity getTarget()
public int getStatus()
INITIAL_STATUS
,
ACTIVATED_STATUS
,
EXPLAINED_STATUS
public java.lang.String getStatusText()
INITIAL_STATUS
,
ACTIVATED_STATUS
,
EXPLAINED_STATUS
public double getActivationStrength()
public double getExplanationStrength()
public SubModel toSubModel()
public double getStrength()
public int getPercentageStrength()
public static double addParallell(double s1, double s2)
public static double addSerial(double s1, double s2)
public boolean isCompletelyMatched()
public boolean isPartlyMatched()
public boolean isUnmatched()
public boolean isExplainMatched()
public java.lang.String shortExplanation()
public java.lang.String toString()
public static EntityComparison createComparison(Entity origin, Entity target)
public int compareTo(java.lang.Object a)
compareTo
in interface java.lang.Comparable
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |