|
Algernon Software | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jatha.dynatype.StandardLispValue org.algernon.rule.Rule
This class represents a Rule in the AAM. It consists of an antecedent, a direction, a consequent and a key.
Field Summary | |
protected LispValue |
BACKWARD
|
protected Algernon |
f_algy
|
protected LispValue |
FORWARD
|
protected Path |
m_antecedent
|
protected Collection |
m_code
|
protected Path |
m_consequent
|
protected int |
m_direction
|
protected int |
m_index
|
protected Clause |
m_key
|
protected String |
m_name
|
static DecimalFormat |
m_nameFormat
|
protected Rule |
m_root
|
protected int |
m_type
|
protected static int |
ruleCounter
|
Fields inherited from class org.jatha.dynatype.StandardLispValue |
f_lisp |
Constructor Summary | |
Rule(Algernon algy,
LispValue ruleForm,
int type,
Rule root)
Create a new Algernon Rule |
|
Rule(Algernon algy,
String name,
LispValue ruleForm,
int type,
Rule root)
Create a new Algernon Rule |
|
Rule(Algernon algy,
String name,
Path antecedent,
int direction,
Path consequent,
Clause key,
int type,
Rule root)
Create a new Algernon Rule |
Method Summary | |
String |
continuationRuleName(int index)
Returns a string containing the name of a continuation rule. |
String |
display(PrintStream out)
Displayable interface. |
LispValue |
findBCRuleCode(Processor processor,
AlgernonKBSet kbSet,
BindingList boundVariables)
Returns the compiled code that is appropriate for the set of bound variables passed in. |
Collection |
getAllCode()
|
Path |
getAntecedent()
Returns the direction of the rule. |
LispValue |
getCode()
Returns the code for a forward chaining rule, or for a backward chaining rule with no bound variables. |
LispValue |
getCode(Processor processor,
AlgernonKBSet kbSet,
BindingList bindings)
Returns the code for a forward chaining rule, or for a backward chaining rule with no bound variables. |
Path |
getConsequent()
|
int |
getDirection()
|
int |
getIndex()
|
Clause |
getKey()
|
String |
getName()
|
static DecimalFormat |
getNameFormat()
|
Rule |
getRoot()
|
int |
getType()
|
boolean |
isBackwardChaining()
Returns true if this rule is a backward-chaining rule. |
boolean |
isForwardChaining()
Returns true if this rule is a forward-chaining rule. |
void |
setAntecedent(Path antecedent)
|
void |
setCode(Collection code)
|
void |
setConsequent(Path consequent)
|
void |
setDirection(int direction)
|
void |
setIndex(int index)
|
void |
setKey(Clause key)
|
void |
setName(String name)
|
static void |
setNameFormat(DecimalFormat nameFormat)
|
void |
setRoot(Rule root)
|
void |
setType(int type)
|
String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected LispValue FORWARD
protected LispValue BACKWARD
protected Algernon f_algy
protected Path m_antecedent
protected Collection m_code
protected Path m_consequent
protected int m_direction
protected int m_index
protected Clause m_key
protected String m_name
protected Rule m_root
protected int m_type
public static DecimalFormat m_nameFormat
protected static int ruleCounter
Constructor Detail |
public Rule(Algernon algy, LispValue ruleForm, int type, Rule root) throws AlgernonDataException
public Rule(Algernon algy, String name, LispValue ruleForm, int type, Rule root) throws AlgernonDataException
public Rule(Algernon algy, String name, Path antecedent, int direction, Path consequent, Clause key, int type, Rule root)
Method Detail |
public String toString()
toString
in interface LispValue
public String display(PrintStream out)
display
in interface Displayable
public String getName()
public boolean isForwardChaining()
public boolean isBackwardChaining()
public LispValue findBCRuleCode(Processor processor, AlgernonKBSet kbSet, BindingList boundVariables)
public String continuationRuleName(int index)
public Path getAntecedent()
public void setAntecedent(Path antecedent)
public Collection getAllCode()
public LispValue getCode()
public LispValue getCode(Processor processor, AlgernonKBSet kbSet, BindingList bindings)
public void setCode(Collection code)
public Path getConsequent()
public void setConsequent(Path consequent)
public int getDirection()
public void setDirection(int direction)
public Clause getKey()
public void setKey(Clause key)
public void setName(String name)
public int getType()
public void setType(int type)
public static DecimalFormat getNameFormat()
public static void setNameFormat(DecimalFormat nameFormat)
public int getIndex()
public void setIndex(int index)
public Rule getRoot()
public void setRoot(Rule root)
|
Algernon Software | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |