|
ABLE, Version 1.1b | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.able.beans.rules.AbleClause
A Clause uses a relational operator to compare two Atoms (Facts, Variables, Sensors, or their derivatives). When evaluated, a clause can return one of three states as its truth value: true, false, and null, which is the case if either of the Atoms have null values. Note that this base clause is an antecedent clause.
Version Description -------- ----------- 1.0.0 Initial release.
Field Summary | |
protected double |
clauseWeight
|
protected AbleRuleCondition |
cond
cond is the relation to be used to evaluate the lhs against the rhs of the clause. |
protected AbleAtom |
lhs
lhs represents the lefthand side of the clause |
protected AbleAtom |
rhs
rhs represents the righthand side of the clause |
protected java.util.Vector |
ruleRefs
ruleRefs is a list of rules that reference this clause. |
protected java.lang.Object[] |
sensorArgs
args is an array of objects to be passed to the effector or sensor as parameters when the method is invoked by the manager. |
protected AbleSensorManager |
sensorManager
sensorManager is the inference engine that has registered the named sensor. |
protected java.lang.String |
sensorName
sensorName is the name of a sensor (encapsulated method) that is registered with the sensorManager. |
protected java.lang.Boolean |
truth
truth contains the current truth value of the clause if it has been evaluated (either true or false, or null if the truth value is unknown or cannot be evaluated (one of the operands has not been set). |
Constructor Summary | |
AbleClause()
Create a new, empty, clause whose truth value is unknown. |
|
AbleClause(AbleAtom theLefthandSide,
AbleRuleCondition theCondition,
AbleAtom theRighthandSide)
Create a new clause with the specified parts. |
|
AbleClause(AbleAtom theLefthandSide,
AbleRuleCondition theCondition,
AbleSensorManager theSensorManager,
java.lang.String theSensorName,
java.lang.Object[] theSensorArgs)
Create a new clause with the specified parts. |
|
AbleClause(AbleAtom theLefthandSide,
AbleRuleCondition theCondition,
java.lang.String theRighthandSide)
Create a new clause with the specified parts. |
Method Summary | |
void |
addRuleRef(AbleRule aRuleReference)
Register a rule which refers to this clause. |
java.lang.Boolean |
check()
Evaluate this clause and return the truth value. |
protected int |
compareString(java.lang.String val1,
java.lang.String val2)
|
double |
getClauseWeight()
|
AbleRule |
getRule()
Retrieve the first rule on the rule reference list. |
java.lang.Boolean |
getTruth()
Retrieve the clause's truth value. |
boolean |
isConsequent()
Determine whether this clause is a consequent (as opposed to an antecedent) clause. |
java.lang.String |
rlString()
Return a formal able rule language string. |
void |
setClauseWeight(double theClauseWeight)
|
java.lang.String |
toString()
Return the clause in text format for display. |
java.lang.String |
xmlString()
Return a formal XML string. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
protected java.util.Vector ruleRefs
protected AbleAtom lhs
protected AbleRuleCondition cond
protected AbleAtom rhs
protected java.lang.Boolean truth
protected AbleSensorManager sensorManager
protected java.lang.String sensorName
protected java.lang.Object[] sensorArgs
protected double clauseWeight
Constructor Detail |
public AbleClause()
public AbleClause(AbleAtom theLefthandSide, AbleRuleCondition theCondition, AbleAtom theRighthandSide)
theLefthandSide
- The lefthand-side of the clause.
theCondition
- A relation with which to evaluate the two sides of the clause.
theRighthandSide
- The righthand-side of the clause.
public AbleClause(AbleAtom theLefthandSide, AbleRuleCondition theCondition, java.lang.String theRighthandSide)
theLefthandSide
- The lefthand-side of the clause.
theCondition
- A relation with which to evaluate the two sides of the clause.
theRighthandSide
- The righthand-side of the clause.
public AbleClause(AbleAtom theLefthandSide, AbleRuleCondition theCondition, AbleSensorManager theSensorManager, java.lang.String theSensorName, java.lang.Object[] theSensorArgs)
theLefthandSide
- The lefthand-side of the clause.
theCondition
- A relation with which to evaluate the two sides of the clause.
theRighthandSide
- The righthand-side of the clause.
Method Detail |
public void addRuleRef(AbleRule aRuleReference)
aRuleReference
- A rule object which refers to this clause.
public java.lang.Boolean check()
public boolean isConsequent()
public java.lang.Boolean getTruth()
public java.lang.String toString()
protected int compareString(java.lang.String val1, java.lang.String val2)
public AbleRule getRule()
public java.lang.String rlString()
public java.lang.String xmlString()
public void setClauseWeight(double theClauseWeight)
public double getClauseWeight()
|
ABLE, Version 1.1b | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |