jcreek.representation.inference
Class SpreadingActivationRule

java.lang.Object
  extended byjcreek.representation.inference.SpreadingActivationRule
Direct Known Subclasses:
InheritanceMethod

public abstract class SpreadingActivationRule
extends java.lang.Object

This class is an abstract class defining a rule for spreading activation through a semantic network. For each spreading activation, one instance of this class is created.


Constructor Summary
SpreadingActivationRule()
          Creates a new SpreadingActivationRule.
 
Method Summary
abstract  boolean accept(Explanation path)
          Returns true if the rule can accept the Explanation path.
abstract  boolean accept(Relation target)
          Returns true if we can accept the Relation target.
abstract  boolean accept(Relation from, Entity target)
          Returns true if we can accept the Entity target from the Relation from.
 ExplanationModel execute(Entity origin)
          The basic spreading activation algorithm.
protected  ExplanationModel generateModel(Entity origin)
          Method for generating an instance of the model used in the execution of the rule.
 boolean reenter(Entity target)
          This method is called on an entity that has already been spread through, to see if we should spread through it again.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SpreadingActivationRule

public SpreadingActivationRule()
Creates a new SpreadingActivationRule. This rule is limitied to spreading to find relations of the type contained in the RelationTypeSet supplied.

Method Detail

accept

public abstract boolean accept(Relation from,
                               Entity target)
Returns true if we can accept the Entity target from the Relation from. Acceptance means the entity will be added to the set of entites spread to.


accept

public abstract boolean accept(Relation target)
Returns true if we can accept the Relation target. Acceptance means the entity will be added to the set of entites spread to.


accept

public abstract boolean accept(Explanation path)
Returns true if the rule can accept the Explanation path.


reenter

public boolean reenter(Entity target)
This method is called on an entity that has already been spread through, to see if we should spread through it again. It has the same function as enter(), but while enter() is only called the FIRST time an entity is encountered during the spreading activation, reenter() is called the following times. WARNING: This method practically defines the complexity of the spreading operation. If this method is always false, the complexity is linear with the number of concepts in the model. If there is no cap on how many times an entity can be reconsidered, the worst case complexity is infinite! Complexity formula: O(c * n) where c = number of concepts in the model n = number of times a single entity can be reconsidered.


generateModel

protected ExplanationModel generateModel(Entity origin)
Method for generating an instance of the model used in the execution of the rule. This is a seperate method to allow subclasses to use subclasses of ExplanationModel as their data object.


execute

public ExplanationModel execute(Entity origin)
The basic spreading activation algorithm. This method uses accept(), and renter(), and should not normally be rewritten.



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