|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--jess.Rete
The reasoning engine. Executes the built Rete network, and coordinates many other activities.
(C) 1997 Ernest J. Friedman-Hill and Sandia National Laboratories
Field Summary | |
static int |
ACTIVATE
|
static int |
EVERY_TIME
|
static int |
INSTALL
|
Constructor Summary | |
Rete()
Now throws RuntimeException if any intrinsic functions fail to load. |
|
Rete(java.applet.Applet a)
Now throws RuntimeException if any intrinsic functions fail to load. |
Method Summary | |
protected void |
aboutToFire(Activation a)
|
Deffacts |
addDeffacts(Deffacts df)
Creates a new deffacts in this object |
Defglobal |
addDefglobal(Defglobal dg)
Creates a new Defglobal in this object. |
HasLHS |
addDefrule(HasLHS dr)
Creates a new defrule in this object |
Deftemplate |
addDeftemplate(Deftemplate dt)
Creates a new deftemplate in this object. |
void |
addInputRouter(java.lang.String s,
java.io.Reader is,
boolean consoleLike)
|
void |
addJessListener(JessListener jel)
|
void |
addOutputRouter(java.lang.String s,
java.io.Writer os)
|
Userfunction |
addUserfunction(Userfunction uf)
Creates a new function in this object Will happily destroy an old one. |
Userpackage |
addUserpackage(Userpackage up)
Add a Userpackage to this engine. |
int |
assert(Fact f)
Assert a fact |
int |
assertString(java.lang.String s)
Assert a fact, as a String |
void |
clear()
Reinitialize engine Thanks to Karl Mueller for idea |
void |
clearStorage()
Clear the storage used by store() and fetch(). |
int |
doPreAssertionProcessing(Fact f)
|
Value |
executeCommand(java.lang.String cmd)
Stuff to let Java code call functions inside of us. |
Value |
fetch(java.lang.String name)
Retrieve an object previously stored with store(). |
Defglobal |
findDefglobal(java.lang.String name)
|
HasLHS |
findDefrule(java.lang.String name)
Find a defrule object with a certain name |
Deftemplate |
findDeftemplate(java.lang.String name)
Find a deftemplate object with a certain name |
Fact |
findFactByID(int id)
This 'find' is used by the retract that rules use. |
Userfunction |
findUserfunction(java.lang.String name)
Find a userfunction, if there is one. |
java.lang.Object |
getActivationSemaphore()
The monitor of the object returned from this method will be signalled whenever an activation appears. |
java.applet.Applet |
getApplet()
Returns the applet this Rete is installed in. |
java.io.PrintWriter |
getErrStream()
|
int |
getEvalSalience()
Fetch the salience evaluation behaviour |
int |
getEventMask()
|
boolean |
getFactDuplication()
Returns true if duplicate facts are allowed, false otherwise. |
static jess.factory.Factory |
getFactory()
|
Context |
getGlobalContext()
Fetch the global execution context. |
boolean |
getInputMode(java.lang.String s)
|
java.io.Reader |
getInputRouter(java.lang.String s)
|
java.io.Writer |
getOutputRouter(java.lang.String s)
|
java.io.PrintWriter |
getOutStream()
|
boolean |
getResetGlobals()
When resetGlobals is true, the initializers of global variables are evaluated when (reset) is executed. |
void |
halt()
Jane, stop this crazy thing! |
protected void |
justFired(Activation a)
|
java.util.Enumeration |
listActivations()
Return an Enumeration of all the activiations - i.e, the agenda. |
java.util.Enumeration |
listDeffacts()
Return an Enumeration of all the deffacts in this engine. |
java.util.Enumeration |
listDefglobals()
Return an Enumeration of all the defglobals in this engine. |
java.util.Enumeration |
listDefrules()
Return an Enumeration of all the defrules in this engine. |
java.util.Enumeration |
listDeftemplates()
Return an Enumeration of all the deftemplates in this engine, both explicit and implied. |
java.util.Enumeration |
listFacts()
Return an Enumeration of all the facts currently on the fact-list |
java.util.Enumeration |
listFunctions()
Return an Enumeration of all the functions in this engine: built-in, user, and deffunctions. |
java.util.Enumeration |
listJessListeners()
|
java.lang.String |
ppFacts()
|
java.lang.String |
ppFacts(java.lang.String name)
Return the pretty print forms of all facts, as a big string |
void |
removeInputRouter(java.lang.String s)
|
void |
removeJessListener(JessListener jel)
|
void |
removeOutputRouter(java.lang.String s)
|
void |
reset()
Reset the Rete engine. |
Fact |
retract(Fact f)
Retract a fact. |
Fact |
retract(int id)
Retract a fact by ID, used by rule RHSs. |
Fact |
retractString(java.lang.String s)
Karl Mueller NASA/GSFC Code 522.2 (Karl.R.Mueller@gsfc.nasa.gov) 27.January.1998 Retract a fact as a string |
int |
run()
Run the actual engine. |
int |
run(int max)
|
int |
runUntilHalt()
Run until halt() is called. |
void |
setApplet(java.applet.Applet a)
Associates this Rete with an applet so that, for instance, the (batch) commands will look for scripts using the applet's document base URL. |
void |
setEvalSalience(int method)
Set the salience evaluation behaviour. |
void |
setEventMask(int i)
|
void |
setFactDuplication(boolean v)
Turn fact-duplication on or off. |
static void |
setFactory(jess.factory.Factory f)
|
void |
setResetGlobals(boolean reset)
When resetGlobals is true, the initializers of global variables are evaluated when (reset) is executed. |
java.lang.String |
setStrategy(Strategy s)
|
Value |
store(java.lang.String name,
java.lang.Object val)
Store a value in the engine under a given name for later retrieval by fetch. |
Value |
store(java.lang.String name,
Value val)
Store a value in the engine under a given name for later retrieval by fetch. |
Value |
unDefrule(java.lang.String name)
|
void |
waitForActivations()
Waits on the activation lock until a rule is activated. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public static final int INSTALL
public static final int ACTIVATE
public static final int EVERY_TIME
Constructor Detail |
public Rete()
public Rete(java.applet.Applet a)
a
- If this Rete object is being created inside an applet,
pass it as an argument.Method Detail |
public java.applet.Applet getApplet()
public void setApplet(java.applet.Applet a)
a
- The appletpublic final Context getGlobalContext()
public final void setResetGlobals(boolean reset)
reset
- The value of this propertypublic final boolean getResetGlobals()
public final void setEvalSalience(int method) throws JessException
method
- One of the acceptable valuespublic final int getEvalSalience()
public void addInputRouter(java.lang.String s, java.io.Reader is, boolean consoleLike)
s
- is
- consoleLike
- public void addOutputRouter(java.lang.String s, java.io.Writer os)
s
- os
- public void removeInputRouter(java.lang.String s)
s
- public void removeOutputRouter(java.lang.String s)
s
- public java.io.Reader getInputRouter(java.lang.String s)
s
- public boolean getInputMode(java.lang.String s)
s
- public java.io.Writer getOutputRouter(java.lang.String s)
s
- public boolean getFactDuplication()
public void setFactDuplication(boolean v)
v
- Value to assign to factDuplication.public Value store(java.lang.String name, Value val)
name
- A key under which to file the valueval
- The value to storepublic Value store(java.lang.String name, java.lang.Object val)
name
- A key under which to file the valueval
- The value to storepublic Value fetch(java.lang.String name)
name
- The key under which to find an objectstore(java.lang.String, jess.Value)
public void clearStorage()
public static jess.factory.Factory getFactory()
public static void setFactory(jess.factory.Factory f)
public java.io.PrintWriter getErrStream()
public java.io.PrintWriter getOutStream()
public void clear() throws JessException
public void reset() throws JessException
public int assertString(java.lang.String s) throws JessException
s
- public int assert(Fact f) throws JessException
f
- A Fact object. This fact becomes the property of Jess
after calling assert() -- don't change any of its fields until
the fact is retracted!public java.lang.Object getActivationSemaphore()
public void waitForActivations()
getAssertLock
public int doPreAssertionProcessing(Fact f) throws JessException
public Fact retractString(java.lang.String s) throws JessException
s
- public Fact retract(Fact f) throws JessException
f
- A Fact object. Doesn't need to be the actual object that appears on
the fact-list; can just be a Fact that could compare equal to one.public Fact retract(int id) throws JessException
id
- The fact-id of a factpublic Fact findFactByID(int id) throws JessException
id
- The fact-idpublic java.lang.String ppFacts(java.lang.String name)
name
- public java.lang.String ppFacts()
public java.util.Enumeration listDeffacts()
public java.util.Enumeration listDeftemplates()
public java.util.Enumeration listDefrules()
public java.util.Enumeration listFacts()
public java.util.Enumeration listActivations()
public java.util.Enumeration listDefglobals()
public java.util.Enumeration listFunctions()
public final HasLHS findDefrule(java.lang.String name)
name
- public Deftemplate findDeftemplate(java.lang.String name)
name
- public Deftemplate addDeftemplate(Deftemplate dt) throws JessException
dt
- public Deffacts addDeffacts(Deffacts df) throws JessException
df
- public Defglobal addDefglobal(Defglobal dg) throws JessException
dg
- public Defglobal findDefglobal(java.lang.String name)
name
- public Userfunction addUserfunction(Userfunction uf)
uf
- A new USerfunctionpublic Userpackage addUserpackage(Userpackage up)
up
- The package objectpublic final Userfunction findUserfunction(java.lang.String name)
name
- The name of the functionpublic final HasLHS addDefrule(HasLHS dr) throws JessException
dr
- public final Value unDefrule(java.lang.String name) throws JessException
name
- public java.lang.String setStrategy(Strategy s) throws JessException
s
- public int run() throws JessException
protected void aboutToFire(Activation a)
protected void justFired(Activation a)
public int run(int max) throws JessException
max
- public int runUntilHalt() throws JessException
public Value executeCommand(java.lang.String cmd) throws JessException
cmd
- public void halt()
public java.util.Enumeration listJessListeners()
public void addJessListener(JessListener jel)
jel
- public void removeJessListener(JessListener jel)
jel
- public int getEventMask()
public void setEventMask(int i)
|
© 1997 E.J. Friedman-Hill and Sandia Corporation | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |