jcreek.representation.inference
Class ExplanationModel

java.lang.Object
  extended byjcreek.representation.SubModel
      extended byjcreek.representation.inference.ExplanationModel

public class ExplanationModel
extends SubModel

This class represents a subset of the knowledge model resulting from a spreading activation operation from the "origin" entity. This class is created by a SpreadingActivationRule and is not to be created directly.


Field Summary
 double MINIMUM_STRENGTH_TRESHOLD
           
 
Method Summary
 int assessGetPathsComplexity()
          Returns an integer assessing the maximal complexity of finding all paths in a submodel.
 SubModel getActivatedModel(RelationType rcd, Entity target)
          Returns a submodel containing all enties and relations of all paths from the origin to the designated entity where the last step of all paths is of the RelationType designated.
 Explanation[] getExplanations(Entity target, int acceptedComplexity)
          Exhaustive, depth-first search for paths within the submodel.
 Explanation[] getExplanations(RelationType rcd, Entity target, int acceptedComplexity)
          Exhaustive, depth-first search for paths within the submodel.
 double getExplanationStrength(Entity target)
           
static double getExplanationStrength(Explanation[] paths, Entity target)
           
 double getExplanationStrength(RelationType rcd, Entity target)
          Returns the activation strength of the target in regards to the origin.
 Explanation getStrongestExplanation(Entity target)
          Returns the explanation representing the strongest path from the origin entity to the target entity.
 Explanation getStrongestExplanation(RelationType rcd, Entity target)
          Returns the explanation representing the strongest path from the origin entity to the target relation.
 
Methods inherited from class jcreek.representation.SubModel
add, add, add, add, add, addExpanded, addExpanded, clear, contains, contains, contains, getEntities, getRelations, joinWith, remove, remove, remove, size, toSet, toString, union
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MINIMUM_STRENGTH_TRESHOLD

public double MINIMUM_STRENGTH_TRESHOLD
Method Detail

getStrongestExplanation

public Explanation getStrongestExplanation(Entity target)
Returns the explanation representing the strongest path from the origin entity to the target entity. This implementation is not optimal - it can be done using a variation of Dijkstra's shortest path algorithm to avoid the complexity of getPaths();


getStrongestExplanation

public Explanation getStrongestExplanation(RelationType rcd,
                                           Entity target)
Returns the explanation representing the strongest path from the origin entity to the target relation. In cases where the relation is inherited, this path is the single strongest. This implementation is not optimal - it can be done using a variation of Dijkstra's shortest path algorithm to avoid the complexity of getPaths();


getExplanations

public Explanation[] getExplanations(Entity target,
                                     int acceptedComplexity)
                              throws TaskTooComplexException
Exhaustive, depth-first search for paths within the submodel. As this is very computationally though, it demands an integer of how high complexity is accetable and may throw a TaskTooComplexException if the task exceeds the accepted complexity.

Parameters:
target - The entity to look for paths to. (All the paths originate at the origin entity of the SpreadingActivationModel.)
Throws:
TaskTooComplexException

getExplanations

public Explanation[] getExplanations(RelationType rcd,
                                     Entity target,
                                     int acceptedComplexity)
                              throws TaskTooComplexException
Exhaustive, depth-first search for paths within the submodel. As this is potentiallt computationally though, it demands an integer of how high complexity is accetable and may throw a TaskTooComplexException if the task exceeds the accepted complexity.

Parameters:
rcd - RelationType of the relation type we are interested in. Only explanations in which this relation-type is the last relation, are returned.
target - The relation to look for paths to. (All the paths originate at the origin entity of the Explanation.)
Throws:
TaskTooComplexException

assessGetPathsComplexity

public int assessGetPathsComplexity()
Returns an integer assessing the maximal complexity of finding all paths in a submodel. This is equal to no. of relations squared.


getActivatedModel

public SubModel getActivatedModel(RelationType rcd,
                                  Entity target)
Returns a submodel containing all enties and relations of all paths from the origin to the designated entity where the last step of all paths is of the RelationType designated.


getExplanationStrength

public double getExplanationStrength(RelationType rcd,
                                     Entity target)
                              throws TaskTooComplexException
Returns the activation strength of the target in regards to the origin. This calculation is done using only the entities and relations in the set.

Throws:
TaskTooComplexException

getExplanationStrength

public double getExplanationStrength(Entity target)
                              throws TaskTooComplexException
Throws:
TaskTooComplexException

getExplanationStrength

public static double getExplanationStrength(Explanation[] paths,
                                            Entity target)


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