|
JTP API Documentation | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--jtp.disp.SequentialDispatcher
SequentialDispatcher.java Created: Wed Nov 17 00:22:03 1999
Nested Class Summary | |
static interface |
SequentialDispatcher.LocationPreference
|
protected static class |
SequentialDispatcher.Ring
|
Field Summary | |
protected int |
count
|
protected boolean |
cutoff
|
static int |
HEAD_PREFERRED
|
static int |
NO_PREFERENCE
|
static int |
TAIL_PREFERRED
|
protected SequentialDispatcher.Ring |
zero
|
Constructor Summary | |
SequentialDispatcher()
|
Method Summary | |
boolean |
acceptable(Object o)
decides if the goal is suitable for being processed by this reasoner. |
boolean |
addReasoner(Reasoner r)
Add a reasoner directly to this dispatcher. |
boolean |
getCutoff()
returns the cutoff setting for this dispatcher. |
Class |
getReasonerClass()
Returns the class of reasoners this dispatcher works with. |
Collection |
getReasoners()
Retrieves the collection of child reasoners directly beneath this dispatcher. |
ReasoningStepIterator |
process(Object o)
This method attempts to find proof for the goal. |
boolean |
removeReasoner(Reasoner r)
Removes a reasoner directly from this dispatcher. |
void |
setCutoff(boolean cutoff)
sets the value for the cutoff property. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected SequentialDispatcher.Ring zero
protected int count
protected boolean cutoff
public static final int HEAD_PREFERRED
public static final int TAIL_PREFERRED
public static final int NO_PREFERENCE
Constructor Detail |
public SequentialDispatcher()
Method Detail |
public ReasoningStepIterator process(Object o)
Reasoner
Example. A reasoner that performs unification of the goal with facts in a
knowledge base can return the following enumeration for the goal (parent joe ?x)
:
(parent joe fred)
with variable assignment
?x=fred,(parent joe mary)
with variable assignment
?x=mary.
process
in interface Reasoner
o
- the goal: either a query or an assertion
public boolean acceptable(Object o)
Reasoner
Example. Many reasoners only process literals with certain predicates and arity. These reasoners will use those criteria to determine acceptability, for example a reasoner dealing with equality could accept goals that are:
acceptable
in interface Reasoner
public boolean getCutoff()
setCutoff(boolean)
public void setCutoff(boolean cutoff)
Example. There are 3 child reasoners, A, B and C. A query is given; A returns an empty reasoner step iterator, B returns one with two reasoning steps, B1 and B2; C returns an iterator with a single reasoning step, C1. The reasoning step iterator returned by the dispatcher will be:
false
, { B1, B2, C1 },true
, { B1, B2 }.
cutoff
- true if the dispatcher should drop the results from tail reasoners.public boolean addReasoner(Reasoner r)
Dispatcher
DispatcherUtils.addToDispatcher(jtp.Reasoner, jtp.Dispatcher)
.
addReasoner
in interface Dispatcher
r
- the reasoner to add
public boolean removeReasoner(Reasoner r)
Dispatcher
DispatcherUtils.removeFromDispatcher(jtp.Reasoner, jtp.Dispatcher)
.
removeReasoner
in interface Dispatcher
r
- the reasoner to remove
public Class getReasonerClass()
Dispatcher
getReasonerClass
in interface Dispatcher
public Collection getReasoners()
Dispatcher
getReasoners
in interface Dispatcher
|
JTP API Documentation | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |