jcreek.reasoning
Class CaseFindingComparison

java.lang.Object
  extended byjcreek.reasoning.EntityComparison
      extended byjcreek.reasoning.CaseFindingComparison
All Implemented Interfaces:
java.lang.Comparable

public class CaseFindingComparison
extends EntityComparison

Title: CaseFindingComparison

Description: Structure used when matching two cases. This structure contains a matching of two findings of the cases. This is not really a

Version:
1.0
Author:
Frode Sørmo

Field Summary
protected  EntityComparison comparison
           
protected  Relation fromOrigin
           
protected  Relation fromTarget
           
protected  double relevance
           
 
Fields inherited from class jcreek.reasoning.EntityComparison
ACTIVATED_STATUS, activationStrength, EXPLAINED_STATUS, explanationStrength, INITIAL_STATUS, INITIAL_STRENGTH, origin, target
 
Constructor Summary
CaseFindingComparison(Relation fromOrigin, Relation fromTarget)
          Creates a new CaseFindingComparison comparing the two relations given.
 
Method Summary
 void activate()
          Activates the comparison between the origin and target concepts.
 void explain()
          Explains the comparison between the origin and target concepts.
 double getActivationStrength()
          Returns the activation strength of the comparisons.
 EntityComparison getComparison()
          Gives the encapsulated comparison.
 EntityComparison getEntityComparison()
          Returns the comparison comparing the entities that are the values of the finding-relations of the origin (new) and target (retrieved) case.
 double getExplanationStrength()
          Returns the explanation strength of the comparisons.
 Relation getOriginRelation()
          Returns the finding-relation from the origin (new) case that is the basis of this comparison.
 double getRelevance()
          Returns the relevance weight of this comparison.This may vary from getTargetRelation().getRelevance() since that relation may be matched to more than one relation in the origin (new) case.
 int getStatus()
          Returns the status of the comparison.
 Relation getTargetRelation()
          Return the finding-relation from the target (retrieved) case that is the basis of this comparison.
 void reset()
          Resets the activation/explanation.
 void setRelevance(double d)
          Sets the relevance weight of this CaseFindingComparison.
 java.lang.String shortExplanation()
          Gives a short textual representation (a sentence or so) describing the comparison.
 SubModel toSubModel()
          Returns a submodel of the entities compared.
 double updateActivationStrength()
          Updates the activation strength.
 double updateExplanationStrength()
          Updates the explanation strength.
 
Methods inherited from class jcreek.reasoning.EntityComparison
addParallell, addSerial, checkIsComparable, compareTo, createComparison, getKnowledgeModel, getOrigin, getPercentageStrength, getStatusText, getStrength, getTarget, isActivated, isComparable, isComparable, isCompletelyMatched, isExplained, isExplainMatched, isPartlyMatched, isUnmatched, toString, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

fromOrigin

protected Relation fromOrigin

fromTarget

protected Relation fromTarget

comparison

protected EntityComparison comparison

relevance

protected double relevance
Constructor Detail

CaseFindingComparison

public CaseFindingComparison(Relation fromOrigin,
                             Relation fromTarget)
Creates a new CaseFindingComparison comparing the two relations given. The EntityComparison.createComparison() method is used to create the actual comparator - this class just wraps around that and also contains the relations and relevance strength.

Parameters:
fromOrigin - The relation from the origin (new) case.
fromTarget - The relation from the target (retrieved) case.
Method Detail

reset

public void reset()
Description copied from class: EntityComparison
Resets the activation/explanation. i.e sets the status to INITIAL_STATUS and strength to INITIAL_STRENGTH.

Overrides:
reset in class EntityComparison

activate

public void activate()
Description copied from class: EntityComparison
Activates the comparison between the origin and target concepts. i.e sets the status to ACTIVATED_STATUS and computes the activation strength if the concepts are comparable and the depth is above threshold.

Overrides:
activate in class EntityComparison
See Also:
EntityComparison.isComparable()

explain

public void explain()
Description copied from class: EntityComparison
Explains the comparison between the origin and target concepts. i.e sets the status to EXPLAINED_STATUS and computes the explanation strength if the concepts are comparable and the depth is above threshold.

Overrides:
explain in class EntityComparison
See Also:
EntityComparison.isComparable()

getStatus

public int getStatus()
Description copied from class: EntityComparison
Returns the status of the comparison.

Overrides:
getStatus in class EntityComparison
Returns:
the status of the comparison
See Also:
INITIAL_STATUS, ACTIVATED_STATUS, EXPLAINED_STATUS

toSubModel

public SubModel toSubModel()
Description copied from class: EntityComparison
Returns a submodel of the entities compared.

Overrides:
toSubModel in class EntityComparison

shortExplanation

public java.lang.String shortExplanation()
Description copied from class: EntityComparison
Gives a short textual representation (a sentence or so) describing the comparison.

Overrides:
shortExplanation in class EntityComparison

updateActivationStrength

public double updateActivationStrength()
Updates the activation strength.

Specified by:
updateActivationStrength in class EntityComparison
Returns:
the activation strength of the comparison

updateExplanationStrength

public double updateExplanationStrength()
Updates the explanation strength.

Specified by:
updateExplanationStrength in class EntityComparison
Returns:
the explanation strength of the comparison

getComparison

public EntityComparison getComparison()
Gives the encapsulated comparison.


setRelevance

public void setRelevance(double d)
Sets the relevance weight of this CaseFindingComparison. This may vary from getTargetRelation().getRelevance() since that relation may be matched to more than one relation in the origin (new) case. If this is the case, the relevance is divided by the number of such matches.


getRelevance

public double getRelevance()
Returns the relevance weight of this comparison.This may vary from getTargetRelation().getRelevance() since that relation may be matched to more than one relation in the origin (new) case. If this is the case, the relevance is divided by the number of such matches.


getOriginRelation

public Relation getOriginRelation()
Returns the finding-relation from the origin (new) case that is the basis of this comparison.


getTargetRelation

public Relation getTargetRelation()
Return the finding-relation from the target (retrieved) case that is the basis of this comparison.


getEntityComparison

public EntityComparison getEntityComparison()
Returns the comparison comparing the entities that are the values of the finding-relations of the origin (new) and target (retrieved) case.


getActivationStrength

public double getActivationStrength()
Returns the activation strength of the comparisons.

Overrides:
getActivationStrength in class EntityComparison

getExplanationStrength

public double getExplanationStrength()
Returns the explanation strength of the comparisons.

Overrides:
getExplanationStrength in class EntityComparison


Created at IDI, NTNU by the Artificial Intelligence and Learning group