|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jess.Node jess.HasLHS jess.Defrule
A Defrule is a specific action meant to be taken when certain conditions are met in working memory. Although you can construct Defrules from the Java API, they are almost always parsed from "defrule" constructs in the Jess language. Building a Defrule from Java is very complicated.
(C) 2005 Sandia National Laboratories
Field Summary |
Fields inherited from class jess.Node |
LEFT, RIGHT |
Constructor Summary | |
Defrule(java.lang.String name,
java.lang.String docstring,
Rete engine)
|
Method Summary | |
java.lang.Object |
accept(Visitor jv)
Defrule participates in the Visitor pattern. |
void |
addAction(Funcall fc)
Add an action to this defrule |
void |
addCE(jess.ConditionalElementX ce,
Rete engine)
Add a conditional element (a pattern or group of patterns) to this rule. |
void |
callNodeLeft(int tag,
Token token,
Context context)
An implementation detail, public only because Jave requires methods that implement an interface to be public. |
int |
evalSalience(Rete engine)
Evaluate the salience of this rule. |
Funcall |
getAction(int idx)
Fetch the idx-th RHS action of this rule. |
boolean |
getAutoFocus()
Indicate whether this rule will automatically focus its module when it is activated. |
java.lang.String |
getConstructType()
Return the type of this construct |
int |
getNActions()
Fetch the number of actions on this rule's RHS |
int |
getSalience()
Fetch the current salience value for this rule. |
Value |
getSalienceValue()
Fetch the raw salience for this rule as a jess.Value. |
boolean |
hasNonDefaultSalience()
Indicate whether this rule's salience is different from the default value. |
boolean |
isNoLoop()
Indicate whether this rule can activate itself through actions it takes on its RHS. |
boolean |
isRelevantChange(int factIndex,
Token token,
Context context)
Implementation detail. |
void |
setAutoFocus(boolean autoFocus)
Tell this rule whether to automatically focus the module it appears in when the rule is activated. |
void |
setNoLoop(boolean b)
Specify whether this rule can activate itself through actions it takes on its RHS. |
void |
setSalience(Value v,
Rete engine)
Set the salience of this rule. |
java.lang.String |
toString()
Returns a brief description of this rule |
Methods inherited from class jess.HasLHS |
addNode, getConditionalElements, getDisplayName, getDocstring, getGroupSize, getModule, getName, getNext, getNodeCount, getNodeIndexHash, getNodes, getPatternCount, listNodes, setLHS, setNodeIndexHash |
Methods inherited from class jess.Node |
addJessListener, getSuccessors, removeJessListener |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Defrule(java.lang.String name, java.lang.String docstring, Rete engine) throws JessException
Method Detail |
public final int getSalience()
public Value getSalienceValue()
public void setSalience(Value v, Rete engine) throws JessException
v
- the salience expressionengine
- a Rete object to provide an execution context
JessException
- if anything goes wrongpublic int evalSalience(Rete engine) throws JessException
engine
- The Rete engine the rule belongs to
JessException
- If something goes wrongpublic boolean hasNonDefaultSalience()
public boolean getAutoFocus()
public void setAutoFocus(boolean autoFocus)
autoFocus
- the desired value of this property.public void addCE(jess.ConditionalElementX ce, Rete engine) throws JessException
addCE
in class HasLHS
ce
- the conditional element to addengine
- the rule engine that provides the execution context
JessException
- if anything goes wrongpublic void callNodeLeft(int tag, Token token, Context context) throws JessException
JessException
public int getNActions()
public Funcall getAction(int idx)
idx
- The zero-based index of the action to fetch
public void addAction(Funcall fc)
fc
- the action as a function callpublic java.lang.Object accept(Visitor jv)
accept
in interface Visitable
accept
in class HasLHS
jv
- a Visitor
public java.lang.String toString()
public void setNoLoop(boolean b)
b
- the desired value of the property.public boolean isNoLoop()
public final java.lang.String getConstructType()
getConstructType
in interface Named
public boolean isRelevantChange(int factIndex, Token token, Context context)
isRelevantChange
in interface jess.MatchInfoSource
|
© 2006 Sandia Corporation | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |