JTP API Documentation

jtp.modelim
Class BreadthFirstForwardReasoner

java.lang.Object
  |
  +--java.beans.beancontext.BeanContextChildSupport
        |
        +--jtp.util.PropertyImporter
              |
              +--jtp.modelim.BreadthFirstForwardReasoner
All Implemented Interfaces:
BeanContextChild, BeanContextServiceRevokedListener, BeanContextServicesListener, EventListener, Reasoner, Serializable

public class BreadthFirstForwardReasoner
extends PropertyImporter
implements Reasoner

A telling control reasoner that implements a breadth-first strategy in the search for derived consequences of an assertion.

Upon receiving an assertion via the process(java.lang.Object) method, this reasoner passes the assertion to a TellingControlDispatcher. The derived consequences received from the dispatcher are subsequently processed in a breadth-first manner.

The BreadthFirstForwardReasoner allows consequences to be derived up to a maximum depth.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.beans.beancontext.BeanContextChildSupport
beanContext, beanContextChildPeer, pcSupport, rejectedSetBCOnce, vcSupport
 
Constructor Summary
BreadthFirstForwardReasoner()
           
 
Method Summary
 boolean acceptable(Object o)
          Returns true if o is a ReasoningStep; returns false otherwise.
 DepthMonitor getDepthMonitor()
           
 int getMaxDepth()
           
 Dispatcher getTellingDispatcher()
           
 Tracer getTracer()
           
 ReasoningStepIterator process(Object o)
          Processes an assertion and its derived consequences.
 void setDepthMonitor(DepthMonitor v)
           
 void setMaxDepth(int v)
           
 void setTellingDispatcher(Dispatcher v)
           
 void setTracer(Tracer v)
           
 
Methods inherited from class jtp.util.PropertyImporter
getImportedProperties, initializeBeanContextResources, setImportedProperties
 
Methods inherited from class java.beans.beancontext.BeanContextChildSupport
addPropertyChangeListener, addVetoableChangeListener, firePropertyChange, fireVetoableChange, getBeanContext, getBeanContextChildPeer, isDelegated, releaseBeanContextResources, removePropertyChangeListener, removeVetoableChangeListener, serviceAvailable, serviceRevoked, setBeanContext, validatePendingSetBeanContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BreadthFirstForwardReasoner

public BreadthFirstForwardReasoner()
Method Detail

getTracer

public Tracer getTracer()

setTracer

public void setTracer(Tracer v)

getTellingDispatcher

public Dispatcher getTellingDispatcher()

setTellingDispatcher

public void setTellingDispatcher(Dispatcher v)

getDepthMonitor

public DepthMonitor getDepthMonitor()

setDepthMonitor

public void setDepthMonitor(DepthMonitor v)

getMaxDepth

public int getMaxDepth()

setMaxDepth

public void setMaxDepth(int v)

process

public ReasoningStepIterator process(Object o)
                              throws ReasoningException
Processes an assertion and its derived consequences. Returns an iterator over the derived consequences of the assertion. The iterator must be exhausted in order for all derived consequences to be processed.

Specified by:
process in interface Reasoner
Parameters:
o - the goal: either a query or an assertion
Returns:
the iterator of reasoning steps - proofs for the query, or consequences of the assertion.
ReasoningException

acceptable

public boolean acceptable(Object o)
Returns true if o is a ReasoningStep; returns false otherwise. Instances of DirectAssertion are generally received by this reasoner because it is usually the top-level telling reasoner in a system.

Specified by:
acceptable in interface Reasoner
Returns:
true if the goal is suitable for this reasoner, false otherwise.

JTP API Documentation