|
ABLE 2.0.0 07/02/2003 10:25:01 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.able.rules.ARL
This class contains constants used as parameters in ABLE Rule Language (ARL) rulesets and several utility methods.
Values are referenced using standard Java dot notation for example: setControlParameter(ARL.DefuzzifyMethod , ARL.Centroid) ; Methods are invokes using standard Java dot notation also for example: ARL.showWorkingMemory(wm) ;
Field Summary | |
---|---|
static long |
ALL_DAYS_OF_MONTH
DAY OF MONTH |
static int |
ALL_DAYS_OF_WEEK
DAY OF WEEK bitmasks -- per IETF Policy Framework Last bit is always 0 |
static int |
ALL_MONTHS
MONTH OF YEAR bitmasks - per IETF Policy Framework |
static java.lang.String |
AlphaCut
Fuzzy alphaCut control parameter |
static int |
APRIL
|
static int |
AUGUST
|
static int |
AverageHeight
Defuzzification method: Average: Take the average height point. |
static int |
Centroid
Defuzzification method: Centroid: Take the center of the fuzzy region. |
static java.lang.String |
ControlStrategy
Forward engine control strategy: |
static java.lang.String |
CorrelationMethod
Fuzzy Correlation method: Product: scale the consequent fuzzy region using the truth of the predicate (the shape of the fuzzy region is preserved): |
static long |
DAY_1
|
static long |
DAY_10
|
static long |
DAY_11
|
static long |
DAY_12
|
static long |
DAY_13
|
static long |
DAY_14
|
static long |
DAY_15
|
static long |
DAY_16
|
static long |
DAY_17
|
static long |
DAY_18
|
static long |
DAY_19
|
static long |
DAY_2
|
static long |
DAY_20
|
static long |
DAY_21
|
static long |
DAY_22
|
static long |
DAY_23
|
static long |
DAY_24
|
static long |
DAY_25
|
static long |
DAY_26
|
static long |
DAY_27
|
static long |
DAY_28
|
static long |
DAY_29
|
static long |
DAY_3
|
static long |
DAY_30
|
static long |
DAY_31
|
static long |
DAY_4
|
static long |
DAY_5
|
static long |
DAY_6
|
static long |
DAY_7
|
static long |
DAY_8
|
static long |
DAY_9
|
static int |
DECEMBER
|
static java.lang.String |
DefuzzifyMethod
Defuzzification method: Centroid: Take the center of the fuzzy region. |
static int |
Down
|
static java.lang.String |
Event
The event control parameter used by event correlation engines |
static int |
FEBRUARY
|
static java.lang.String |
FindAllSolutions
Find All Solutions: |
static int |
FIRE_ALL_RULES
|
static int |
FIRE_N_RULES
|
static int |
FIRE_ONE_RULE
|
static int |
FIRST_QUARTER
|
static int |
FOURTH_QUARTER
|
static int |
FRIDAY
|
static int |
FuzzyAdd
Fuzzy Inference (implication) method: FuzzyAdd: also known as bounded add; the minimum of 1 and the sum of the membership values: |
static java.lang.String |
Goal
The goal control parameter used by backward chaining engines |
static java.lang.String |
InferenceMethod
Fuzzy Inference method: |
static java.lang.String |
init
Rule Block Name: Init |
static int |
JANUARY
|
static int |
JULY
|
static int |
JUNE
|
static long |
LAST_DAY_1
|
static long |
LAST_DAY_10
|
static long |
LAST_DAY_11
|
static long |
LAST_DAY_12
|
static long |
LAST_DAY_13
|
static long |
LAST_DAY_14
|
static long |
LAST_DAY_15
|
static long |
LAST_DAY_16
|
static long |
LAST_DAY_17
|
static long |
LAST_DAY_18
|
static long |
LAST_DAY_19
|
static long |
LAST_DAY_2
|
static long |
LAST_DAY_20
|
static long |
LAST_DAY_21
|
static long |
LAST_DAY_22
|
static long |
LAST_DAY_23
|
static long |
LAST_DAY_24
|
static long |
LAST_DAY_25
|
static long |
LAST_DAY_26
|
static long |
LAST_DAY_27
|
static long |
LAST_DAY_28
|
static long |
LAST_DAY_29
|
static long |
LAST_DAY_3
|
static long |
LAST_DAY_30
|
static long |
LAST_DAY_31
|
static long |
LAST_DAY_4
|
static long |
LAST_DAY_5
|
static long |
LAST_DAY_6
|
static long |
LAST_DAY_7
|
static long |
LAST_DAY_8
|
static long |
LAST_DAY_9
|
static int |
Left
|
static int |
MARCH
|
static int |
MaxHeight
Defuzzification method: MaxHeight: Take the value at the highest point. |
static int |
MAY
|
static int |
Minimum
Fuzzy Correlation method: Minimise: truncate the consequent fuzzy region at the truth of the premise (creating a plateau): |
static int |
MinMax
Fuzzy Inference (implication) method: MinMax: the maximum (of the minimum) membership values: |
static int |
MONDAY
|
static int |
NOVEMBER
|
static java.lang.String |
NumberOfRulesToFire
Forward engine - number of rules to fire: |
static int |
OCTOBER
|
static java.lang.String |
postProcess
Rule Block Name: PostProcess |
static java.lang.String |
preProcess
Rule Block Name: PreProcess |
static java.lang.String |
process
Rule Block Name: Process |
static java.lang.String |
processAbleEvent
Rule Block Name: ProcessAbleEvent |
static java.lang.String |
processTimerEvent
Rule Block Name: ProcessTimerEvent |
static int |
Product
Fuzzy Correlation method: Product: scale the consequent fuzzy region using the truth of the predicate (the shape of the fuzzy region is preserved): |
static int |
ProductOr
Fuzzy Inference (implication) method: ProductOr: |
static java.lang.String |
quitAll
Rule Block Name: QuitAll |
static int |
Right
|
static int |
SATURDAY
|
static int |
SECOND_QUARTER
|
static int |
SEPTEMBER
|
static int |
SUNDAY
|
static int |
THIRD_QUARTER
|
static java.lang.String |
THIS_AND_FUTURE
|
static java.lang.String |
THIS_AND_PRIOR
|
static int |
THURSDAY
|
static int |
TRACE_HIGH
|
static int |
TRACE_LOW
|
static int |
TRACE_MEDIUM
|
static int |
TRACE_NONE
Constants used to set trace levels |
static int |
TUESDAY
|
static int |
Up
|
static int |
WEDNESDAY
|
static int |
WEEKDAY
|
static int |
WEEKEND
|
Constructor Summary | |
---|---|
ARL()
|
Method Summary | |
---|---|
static void |
assertDataSource(AbleWorkingMemory wm,
AbleDataSource dataSource,
java.lang.String className)
Assert all records in a data source into working memory. |
static java.lang.String |
Copyright()
Determine the copyright of this class. |
static void |
fine(AbleRuleSet ruleset,
java.lang.String text)
Write low level text to the ruleset's trace logger. |
static void |
finer(AbleRuleSet ruleset,
java.lang.String text)
Write medium level text to the ruleset's trace logger. |
static void |
finest(AbleRuleSet ruleset,
java.lang.String text)
Write high level text to the ruleset's trace logger. |
static java.util.Vector |
getBeanOutput(AbleBean theBean)
Retrieve the specified bean's output buffer as a Vector of objects regardless of the underlying outputbuffer representation |
static java.lang.String |
getSystemProperty(java.lang.String thePropertyName)
Return the value of the specified system property. |
static java.lang.String |
getSystemProperty(java.lang.String thePropertyName,
java.lang.String theDefaultValue)
Return the value of the specified system property. |
static void |
info(java.lang.String text)
Write informational text to the global message logger. |
static boolean |
invokeCommand(java.lang.String theCommand)
Invoke the command provided; prepend any necessary operating system arguments. |
static boolean |
invokeCommandOS(java.lang.String theCommand)
Invoke the command provided as provided. |
static boolean |
isLeapYear(java.util.GregorianCalendar theCalendar,
int theYear)
Determine whether the specified year is a leap year. |
static boolean |
isTimeAM(java.util.Calendar theCalendar)
Determine whether the time in the specified calendar is AM. |
static boolean |
isTimePM(java.util.Calendar theCalendar)
Determine whether the time in the specified calendar is PM. |
static void |
loadMapFromVars(AbleRuleSet theRuleSet,
java.util.Map theMap,
java.util.Vector theVariableList)
Load the supplied hashmap with matching variables found in the variable list. |
static void |
loadMapFromVars(AbleRuleSet theRuleSet,
java.util.Map theMap,
java.util.Vector theVariableList,
java.lang.Boolean theOverwriteFlag)
Load the supplied hashmap with matching variables found in the variable list. |
static void |
loadVarsFromMap(AbleRuleSet theRuleSet,
java.util.Map theMap)
Load the properties file and assign any matching properties to variables with the same name. |
static void |
loadVarsFromPropertiesFile(AbleRuleSet theRuleSet,
java.lang.String theFileName)
Load the properties file and assign any matching properties to variables with the same name. |
static java.util.Calendar |
parseDateAndTime(java.lang.String theDateString)
Create a Calendar object from a String representation of a date and time using the default date format. |
static java.util.Calendar |
parseDateAndTime(java.lang.String theDateString,
java.lang.String theFormatString)
Create a Calendar object from a String representation of a date and time using the default date format. |
static java.lang.Object |
processRuleSet(AbleRuleSet theRuleSet,
java.lang.Object theInputBuffer)
Call the RuleSet via the process() method, passing a list of parameters via the bean's input buffer and returning the first element of the bean's output buffer in outputList. |
static void |
setAbleEventProcessingStates(AbleBean theAbleBean,
boolean processingEnabled,
boolean postingEnabled)
Deprecated. As of version 1.3d, object.method() syntax makes this method obsolete. Use theAbleBean.setAbleEventProcessingStates(Able.ProcessingEnabled_PostingEnabled); |
static void |
setSystemProperty(java.lang.String thePropertyName,
java.lang.String theValue)
Set a system property to the specified value. |
static void |
setTraceLevel(AbleRuleSet ruleset,
int level)
Set the trace level for a ruleset. |
static void |
severe(java.lang.String text)
Write severe error text to the global message logger. |
static java.lang.String |
showWorkingMemory(AbleWorkingMemory wm)
Returns a formatted string of the contents of the working memory to use for debugging. |
static java.lang.Object[] |
stringToArray(java.lang.String target)
Return a list from a space-delimited String of words. |
static java.util.Vector |
stringToList(java.lang.String target)
Return a list from a space-delimited String of words. |
static java.util.Vector |
stringToList(java.lang.String target,
java.lang.String delimiter)
Return a list from a delimited String of words. |
static java.lang.String |
stringWord(java.lang.String target,
int index)
Return a word from a space-delimited String of words. |
static int |
stringWords(java.lang.String target)
Count the words in a space-delimited String of words. |
static void |
warning(java.lang.String text)
Write warning text to the global message logger. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String Goal
public static final java.lang.String Event
public static final java.lang.String InferenceMethod
Used by the Fuzzy inference engine to specify the algorithm used for inferencing, either ProductOr , FuzzyAdd, or MinMax.
public static final java.lang.String FindAllSolutions
Used by the Predicate inference engine to specify whether the search should stop on the first solution (false) or if all solutions should be found (true)
public static final int FuzzyAdd
minimum( 1, a[i]+b[i] )
Usually used with Product correlation method.
public static final int MinMax
maximum( a[i], b[i] )
Almost always used with Minimise correlation method.
public static final int ProductOr
1 - ( (1-a[i]) * (1-b[i]) )
Usually used with Product correlation method.
public static final java.lang.String CorrelationMethod
a[i] = a[i] * PredicateTruth
Used by the Fuzzy inference engine with InferenceMethod ProductOr or FuzzyAdd.
public static final int Product
a[i] = a[i] * PredicateTruth
Used by the Fuzzy inference engine with InferenceMethod ProductOr or FuzzyAdd.
public static final int Minimum
a[i] = minimum( a[i], PredicateTruth )
Usually used with InferenceMethod MinMax.
public static final java.lang.String DefuzzifyMethod
public static final int Centroid
public static final int MaxHeight
public static final int AverageHeight
public static final java.lang.String AlphaCut
public static final int Up
public static final int Down
public static final int Left
public static final int Right
public static final java.lang.String THIS_AND_PRIOR
public static final java.lang.String THIS_AND_FUTURE
public static final int ALL_MONTHS
Example - 0x8000 = { Jan } Example - 0x0010 = { Dec } Example - 0x1C00 = { Apr, May, June }
public static final int JANUARY
public static final int FEBRUARY
public static final int MARCH
public static final int APRIL
public static final int MAY
public static final int JUNE
public static final int JULY
public static final int AUGUST
public static final int SEPTEMBER
public static final int OCTOBER
public static final int NOVEMBER
public static final int DECEMBER
public static final int FIRST_QUARTER
public static final int SECOND_QUARTER
public static final int THIRD_QUARTER
public static final int FOURTH_QUARTER
public static final int ALL_DAYS_OF_WEEK
Example - 0x80 = { Sunday } Example - 0x7C = { Mon, Tues, Wed, Thurs, Fri } Example - 0x82 = { Sunday, Saturday }
public static final int SUNDAY
public static final int MONDAY
public static final int TUESDAY
public static final int WEDNESDAY
public static final int THURSDAY
public static final int FRIDAY
public static final int SATURDAY
public static final int WEEKDAY
public static final int WEEKEND
public static final long ALL_DAYS_OF_MONTH
First 31 bits are day from start of month Second 31 bits are days from end of month Last 2 bits are always 0
Example 0x80 00 00 01 00 00 00 00
public static final long DAY_1
public static final long DAY_2
public static final long DAY_3
public static final long DAY_4
public static final long DAY_5
public static final long DAY_6
public static final long DAY_7
public static final long DAY_8
public static final long DAY_9
public static final long DAY_10
public static final long DAY_11
public static final long DAY_12
public static final long DAY_13
public static final long DAY_14
public static final long DAY_15
public static final long DAY_16
public static final long DAY_17
public static final long DAY_18
public static final long DAY_19
public static final long DAY_20
public static final long DAY_21
public static final long DAY_22
public static final long DAY_23
public static final long DAY_24
public static final long DAY_25
public static final long DAY_26
public static final long DAY_27
public static final long DAY_28
public static final long DAY_29
public static final long DAY_30
public static final long DAY_31
public static final long LAST_DAY_31
public static final long LAST_DAY_30
public static final long LAST_DAY_29
public static final long LAST_DAY_28
public static final long LAST_DAY_27
public static final long LAST_DAY_26
public static final long LAST_DAY_25
public static final long LAST_DAY_24
public static final long LAST_DAY_23
public static final long LAST_DAY_22
public static final long LAST_DAY_21
public static final long LAST_DAY_20
public static final long LAST_DAY_19
public static final long LAST_DAY_18
public static final long LAST_DAY_17
public static final long LAST_DAY_16
public static final long LAST_DAY_15
public static final long LAST_DAY_14
public static final long LAST_DAY_13
public static final long LAST_DAY_12
public static final long LAST_DAY_11
public static final long LAST_DAY_10
public static final long LAST_DAY_9
public static final long LAST_DAY_8
public static final long LAST_DAY_7
public static final long LAST_DAY_6
public static final long LAST_DAY_5
public static final long LAST_DAY_4
public static final long LAST_DAY_3
public static final long LAST_DAY_2
public static final long LAST_DAY_1
public static final int TRACE_NONE
public static final int TRACE_LOW
public static final int TRACE_MEDIUM
public static final int TRACE_HIGH
public static final java.lang.String init
The "init" rule block is processed once when the AbleRuleSet init() method is invoked.
public static final java.lang.String preProcess
The "preProcess" rule block is meant to be called before the process() rule block is called.
public static final java.lang.String process
The "process" rule block is meant to be processed multiple times, once for each "process" cycle, and it is meant to be processed by a specialized inference engine, such as a fuzzy logic inference engine or a bollean forward chainer. The rules are processed in an order determined by the inference engine.
public static final java.lang.String postProcess
The "postProcess" rule block is meant to be processed each time processing of the process() rule block quiesces.
public static final java.lang.String processTimerEvent
The "processTimerEvent" rule block is called to process timer events generated by the ruleset bean.
public static final java.lang.String processAbleEvent
The "processAbleEvent" rule block is called to process able events received by the ruleset bean due to a handleAbleEvent() (or processAbleEvent()) method invocation. The rules can access the event object via the "event" built-in variable.
public static final java.lang.String quitAll
The "finally" rule block is called when the bean quitAll() method is invoked.
public static final java.lang.String ControlStrategy
Used by the Forward inference engine to specify the algorithm used for inferencing, either FIRE_ALL_RULES , FIRE_ONE_RULE, or FIRE_N_RULES.
public static final int FIRE_ALL_RULES
public static final int FIRE_ONE_RULE
public static final int FIRE_N_RULES
public static final java.lang.String NumberOfRulesToFire
Used by the Forward inference engine to specify the number of rules to fire when FIRE_N_RULES is used as the control strategy.
Constructor Detail |
public ARL()
Method Detail |
public static void severe(java.lang.String text)
text
- The text to be written.public static void warning(java.lang.String text)
text
- The text to be written.public static void info(java.lang.String text)
text
- The text to be written.public static void fine(AbleRuleSet ruleset, java.lang.String text)
ruleset
- The ruleset owning the trace logger.text
- The text to be written.public static void finer(AbleRuleSet ruleset, java.lang.String text)
ruleset
- The ruleset owning the trace logger.text
- The text to be written.public static void finest(AbleRuleSet ruleset, java.lang.String text)
ruleset
- The ruleset owning the trace logger.text
- The text to be written.public static void setTraceLevel(AbleRuleSet ruleset, int level)
ruleset
- The ruleset owning the trace logger.level
- The level to use. ARL.TRACE_NONE, ARL.TRACE_LOW = fine, etcpublic static void loadVarsFromPropertiesFile(AbleRuleSet theRuleSet, java.lang.String theFileName) throws java.rmi.RemoteException
theRuleSet
- The rule set whose variables are to be set using the
properties file.
theFileName
- The complete file path to the specified properties
file.
public static java.lang.String getSystemProperty(java.lang.String thePropertyName) throws java.rmi.RemoteException
thePropertyName
- The String name of the system property.
public static java.lang.String getSystemProperty(java.lang.String thePropertyName, java.lang.String theDefaultValue) throws java.rmi.RemoteException
thePropertyName
- The String name of the system property.
theDefaultValue
- The default value to use if the property does not exist.
public static void setSystemProperty(java.lang.String thePropertyName, java.lang.String theValue) throws java.rmi.RemoteException
thePropertyName
- The String name of the system property.
theValue
- The String value of the specified property.
public static java.util.Vector getBeanOutput(AbleBean theBean) throws java.rmi.RemoteException
Note: Only double[], String[], Object[], and Vector are supported.
theBean
- An AbleBean
java.rmi.RemoteException
- if an error occurs while obtaining the bean's output buffer.public static boolean invokeCommandOS(java.lang.String theCommand) throws java.rmi.RemoteException
Usage:
result = invokeCommand("cmd /c Start command.com")
theCommand
- A String containing the command to be passed to the runtime.AbleException
- On any error.Able.runOS(String)
public static boolean invokeCommand(java.lang.String theCommand) throws java.rmi.RemoteException
Usage:
result = invokeCommand("netscape.exe")
theCommand
- A String containing the command to be passed to the runtime.AbleException
- On any error.public static java.lang.Object processRuleSet(AbleRuleSet theRuleSet, java.lang.Object theInputBuffer) throws java.rmi.RemoteException
Usage: ResultVar = processRuleSet(rs, inputs);
theRuleSet
- An AbleRuleSet.
theInputBuffer
- An Object[] or Vector of values to be passed in the
input buffer of the ruleset.
public static void setAbleEventProcessingStates(AbleBean theAbleBean, boolean processingEnabled, boolean postingEnabled) throws java.rmi.RemoteException
theAbleBean
- An AbleBean object to be invoked.
processingEnabled
- The desired state of asynchronous event processing.
postingEnabled
- The desired state of asynchronous event posting.
public static void assertDataSource(AbleWorkingMemory wm, AbleDataSource dataSource, java.lang.String className) throws java.rmi.RemoteException
wm
- The Working Memory.dataSource
- The AbleDataSource object which provides the data.className
- The name of the class to instantiate for each record, set
its values, and assert to working memory. The class must provide
setter methods for each field in the dataSource. For example, if
there is a field named "weightInKG" there must be a method named
setWeightInKG(Object) in the named class.
public static java.lang.String showWorkingMemory(AbleWorkingMemory wm)
wm
- The working memory object to displaypublic static java.lang.String stringWord(java.lang.String target, int index)
Usage: StringVar1 = word(targetString,3);
target
- The String of space-delimited words.
index
- The position of the word to return.
public static int stringWords(java.lang.String target)
Usage: StringVar1 = words(targetString);
target
- The String of space-delimited words.
public static java.util.Vector stringToList(java.lang.String target)
Usage: ListVar1 = stringToList(targetString);
target
- The String of space-delimited words.
public static java.lang.Object[] stringToArray(java.lang.String target)
Usage: ListVar1 = stringToList(targetString);
target
- The String of space-delimited words.
public static java.util.Vector stringToList(java.lang.String target, java.lang.String delimiter)
Usage: ListVar1 = stringToList(targetString,",");
target
- The String of delimited words.
delimiter
- The delimiter String which separates the words.
public static boolean isTimeAM(java.util.Calendar theCalendar) throws java.rmi.RemoteException
theCalendar
- A Calendar object.
public static boolean isTimePM(java.util.Calendar theCalendar) throws java.rmi.RemoteException
theCalendar
- A Calendar object.
public static boolean isLeapYear(java.util.GregorianCalendar theCalendar, int theYear) throws java.rmi.RemoteException
theCalendar
- A GregorianCalendar object.
theYear
- The year to test.
public static java.util.Calendar parseDateAndTime(java.lang.String theDateString) throws java.text.ParseException, java.rmi.RemoteException
theDateString
- A string representation of a date and time.
public static java.util.Calendar parseDateAndTime(java.lang.String theDateString, java.lang.String theFormatString) throws java.text.ParseException, java.rmi.RemoteException
theDateString
- A string representation of a date and time.
theFormatString
- The date format string; for example, "yyyy.MM.dd G 'at' hh:mm:ss a zzz".
public static void loadVarsFromMap(AbleRuleSet theRuleSet, java.util.Map theMap) throws AbleException
theRuleSet
- The rule set whose variables are to be set using the
properties file.
theMap
- The Map that contains variable content keyed
by variable name.
public static void loadMapFromVars(AbleRuleSet theRuleSet, java.util.Map theMap, java.util.Vector theVariableList) throws AbleException
theRuleSet
- The rule set whose variables are to be set using the
properties file.
theMap
- The Map that contains variable content keyed by variable name.
theVariableList
- The Variable List that contains variable names to be added to the Map.
public static void loadMapFromVars(AbleRuleSet theRuleSet, java.util.Map theMap, java.util.Vector theVariableList, java.lang.Boolean theOverwriteFlag) throws AbleException
theRuleSet
- The rule set whose variables are to be set using the
properties file.
theMap
- The Map that contains variable content keyed by variable name.
theVariableList
- The Variable List that contains variable names to be added to the Map.
theOverwriteFlag
- The Overwrite Flag determines if you can (true) overwrite existing entries in the Map.
public static java.lang.String Copyright()
|
ABLE 2.0.0 07/02/2003 10:25:01 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |