|
ABLE 2.3.0 07/13/2005 14:21:00 | |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||
java.lang.Objectcom.ibm.able.rules.AblePredicateLib
This class implements an alternate math library that takes/returns AbleDoubleLiterals as arguments and defines: plus, minus, times, divideBy for use by Predicate engine.
This class provides a library of mathematical user-defined functions that can be imported into an Able ruleset with an Import() statement. Each public method in this class can then be used as a user-defined function.
| Field Summary | |
|---|---|
protected AbleWorkingMemory |
myWm
|
| Constructor Summary | |
|---|---|
AblePredicateLib()
Create a new math library of user-defined function routines. |
|
| Method Summary | |
|---|---|
boolean |
assertFact(java.lang.Object fact)
|
AbleDoubleLiteral |
divideBy(java.lang.Object theNumberA,
java.lang.Object theNumberB)
Divide A by B and return the result. |
static boolean |
getAnswer(AbleRuleSet theRuleSet)
Return the answer. |
static java.util.Vector |
getGroundSolution(AbleRuleSet theRuleSet,
java.lang.String theRuleBlockKey,
int theIndex)
Return the solution at the specified index in the solutionList. |
static java.util.Vector |
getSolution(AbleRuleSet theRuleSet,
java.lang.String theRuleBlockKey,
int theIndex)
Return the solution at the specified index in the solutionList. |
static java.util.Vector |
getSolutionList(AbleRuleSet theRuleSet,
java.lang.String theRuleBlockKey)
Return the solutionList. |
AbleDoubleLiteral |
minus(java.lang.Object theNumberA,
java.lang.Object theNumberB)
Subtract B from A and return the result. |
AbleDoubleLiteral |
plus(java.lang.Object theNumberA,
java.lang.Object theNumberB)
Add two numbers and return the result. |
boolean |
retractFact(java.lang.Object fact)
|
void |
setPredicateWorkingMemory(AbleWorkingMemory wm)
|
AbleDoubleLiteral |
times(java.lang.Object theNumberA,
java.lang.Object theNumberB)
Multiply B by A and return the result. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected AbleWorkingMemory myWm
| Constructor Detail |
public AblePredicateLib()
| Method Detail |
public AbleDoubleLiteral plus(java.lang.Object theNumberA,
java.lang.Object theNumberB)
throws AbleDataException
theNumberA - A number.
theNumberB - A number.
AbleDataException
public AbleDoubleLiteral minus(java.lang.Object theNumberA,
java.lang.Object theNumberB)
throws AbleDataException
theNumberA - A number.
theNumberB - A number.
AbleDataException
public AbleDoubleLiteral times(java.lang.Object theNumberA,
java.lang.Object theNumberB)
throws AbleDataException
theNumberA - A number.
theNumberB - A number.
AbleDataException
public AbleDoubleLiteral divideBy(java.lang.Object theNumberA,
java.lang.Object theNumberB)
throws AbleDataException
theNumberA - The dividend number.
theNumberB - The divisor number.
AbleDataException
public static java.util.Vector getSolutionList(AbleRuleSet theRuleSet,
java.lang.String theRuleBlockKey)
throws AbleException
theRuleSet -
AbleException
public static java.util.Vector getSolution(AbleRuleSet theRuleSet,
java.lang.String theRuleBlockKey,
int theIndex)
throws AbleException
theRuleSet - theRuleBlockKey - The key of the ruleblocktheIndex - The index of the element in the solutionList to return
AbleException
public static java.util.Vector getGroundSolution(AbleRuleSet theRuleSet,
java.lang.String theRuleBlockKey,
int theIndex)
throws AbleException
theRuleSet - theRuleBlockKey - The key of the ruleblocktheIndex - The index of the element in the solutionList to return
AbleException
public static boolean getAnswer(AbleRuleSet theRuleSet)
throws AbleException
AbleExceptionpublic void setPredicateWorkingMemory(AbleWorkingMemory wm)
public boolean assertFact(java.lang.Object fact)
public boolean retractFact(java.lang.Object fact)
|
ABLE 2.3.0 07/13/2005 14:21:00 | |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||