|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjcreek.reasoning.EntityComparison
jcreek.reasoning.CaseComparison
A comparison between two cases.
The comparison is comparable if the entities have one parent in common. Two entities are compared by comparing the relations of the entities, i.e. by creating relation comparisons of every possible combination, (followed by activation and explanation) and computing the strength.
Field Summary | |
protected java.util.Vector |
comparisons
The list of all finding comparisons |
protected java.util.Hashtable |
findingToComparisons
Hashtable of finding-relation => comparisons involving that finding-relation. |
protected double |
relevanceStrengthSum
The sum of all the relvance strengths of the target cases findings. |
static double |
UNMATCHED_ORIGIN_PENALTY
Constant that gives the maximum penalty for unmatched origin findings. |
protected java.util.Vector |
unmatchedOrigin
List of unmatched target relations. |
protected java.util.Vector |
unmatchedTarget
List of unmatched target relations. |
Fields inherited from class jcreek.reasoning.EntityComparison |
ACTIVATED_STATUS, activationStrength, EXPLAINED_STATUS, explanationStrength, INITIAL_STATUS, INITIAL_STRENGTH, origin, target |
Constructor Summary | |
CaseComparison(Entity origin,
Entity target)
Creates a new comparison between the origin case and the target case with default depth depth. |
Method Summary | |
boolean |
findingsComparable(Relation origin,
Relation target)
|
static Entity[] |
getCompleteFindingList(Case[] cases)
|
CaseFindingComparison[] |
getCompletelyMatchedComparisons()
Returns the list of completely matched finding comparisons. |
CaseFindingComparison[] |
getExplainedMatchedComparisons()
Returns the list of explained matched finding comparisons. |
CaseFindingComparison[] |
getFindingComparisons()
Returns the list of all finding comparisons. |
Relation[] |
getOriginRelations()
Returns all the relations of origin entity of the comparison. |
Relation[] |
getOriginRelations(RelationType relationClass)
Returns all the relations of the given type of origin entity of the comparison. |
CaseFindingComparison[] |
getPartlyMatchedComparisons()
Returns the list of partly matched finding comparisons. |
static double |
getRelevanceFactor(Relation finding)
|
double |
getRelevanceFactorSum()
Returns the sum of the relevance factors of all findings in the target case. |
double |
getStrength()
Returns the total strength of the case comparison, defined as: activation strength+explanation strength-penalty for unmatched origin findings. |
Relation[] |
getTargetRelations()
Returns all the relations of the target entity of the comparison. |
Relation[] |
getTargetRelations(RelationType relationClass)
Returns all the relations of the given type of target entity of the comparison. |
CaseFindingComparison[] |
getUnmatchedComparisons()
Returns the list of unmatched finding comparisons. |
Relation[] |
getUnmatchedOriginRelations()
Return the finding-relations in the origin case that are currently not matched with any relations in the target case. |
double |
getUnmatchedPenalty()
Returns the penalty applied to the score for a case for each unmatched origin case finding. |
Relation[] |
getUnmatchedTargetRelations()
Return the finding-relations in the target case that are currently not matched with any relations in the origin case. |
boolean |
hasFindings()
|
void |
reset()
Resets the comparison. |
java.lang.String |
toString()
Returns the string representation of the entity comparison |
SubModel |
toSubModel()
Returns a submodel of the entities compared. |
protected double |
updateActivationStrength()
Activates the comparison and returns the activation strenght. |
protected double |
updateExplanationStrength()
Explains the comparison and returns the explanation strenght. |
Methods inherited from class jcreek.reasoning.EntityComparison |
activate, addParallell, addSerial, checkIsComparable, compareTo, createComparison, explain, getActivationStrength, getExplanationStrength, getKnowledgeModel, getOrigin, getPercentageStrength, getStatus, getStatusText, getTarget, isActivated, isComparable, isComparable, isCompletelyMatched, isExplained, isExplainMatched, isPartlyMatched, isUnmatched, shortExplanation, update |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected java.util.Vector comparisons
protected java.util.Hashtable findingToComparisons
protected java.util.Vector unmatchedTarget
protected java.util.Vector unmatchedOrigin
protected double relevanceStrengthSum
public static final double UNMATCHED_ORIGIN_PENALTY
Constructor Detail |
public CaseComparison(Entity origin, Entity target)
origin
- the case to compare fromtarget
- the case to compare toDEFAULT_DEPTH
Method Detail |
public static double getRelevanceFactor(Relation finding)
public void reset()
reset
in class EntityComparison
public boolean findingsComparable(Relation origin, Relation target)
protected double updateActivationStrength()
updateActivationStrength
in class EntityComparison
protected double updateExplanationStrength()
updateExplanationStrength
in class EntityComparison
public Relation[] getOriginRelations()
public Relation[] getOriginRelations(RelationType relationClass)
relationClass
- the class of relations to return for the origin entity.
public Relation[] getTargetRelations()
public Relation[] getTargetRelations(RelationType relationClass)
relationClass
- the class of relations to return for the target entity.
public CaseFindingComparison[] getFindingComparisons()
public CaseFindingComparison[] getCompletelyMatchedComparisons()
public CaseFindingComparison[] getPartlyMatchedComparisons()
public CaseFindingComparison[] getUnmatchedComparisons()
public Relation[] getUnmatchedOriginRelations()
public Relation[] getUnmatchedTargetRelations()
public double getRelevanceFactorSum()
public double getStrength()
getStrength
in class EntityComparison
public double getUnmatchedPenalty()
public CaseFindingComparison[] getExplainedMatchedComparisons()
public boolean hasFindings()
public java.lang.String toString()
toString
in class EntityComparison
public SubModel toSubModel()
toSubModel
in class EntityComparison
public static Entity[] getCompleteFindingList(Case[] cases)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |