There are a number of different types of boolean and fuzzy rule examples. The majority of the examples are source ruleset files that can be loaded into the ruleset editor and then from within that development environment, the rulesets can be modified, recompiled, processed, and debugged.
To start the ruleset editor, use the runRsEditor command which is located in the ABLE bin directory. The editor also can be started from within the Able Agent Editor environment by using the Tools/RuleSet Editor... menu item from the menu bar.
Once the ruleset editor is running, make note of the following menu and tool bar items:
These are the editor actions you will use to "play" with the source rulesets.
To load a ruleset into the editor, use one of the editor's Open... menu items. The editor identifies source ruleset files as follows:
File Extension | File Type |
---|---|
.rs | SOURCE RuleSet Files |
.rs_ser | SERIALIZED RuleSet Files |
.rs_xml | XML RuleSet Documents |
After initially loading a source ruleset file into the editor or after making any change to a ruleset, always use Verify to recompile the ruleset and make it ready to run. To run the ruleset, use Run. If you wish to graphically view the fuzzy sets defined in a fuzzy ruleset, use View fuzzy sets....
Note that any source rule language file may be saved as an XML document using the ruleset editor actions Save XML and Save XML as....
The following rulesets can be loaded into the editor and then viewed, changed, and run from there:
Do not bother to Run the ruleset.
In addition to reading source ruleset files, the ruleset editor can read XML documents. When an XML document is loaded into the ruleset editor (using the Open XML editor action) the XML statements are converted to Able Rule Language (ARL) statements, which are more concise and easier to read. You can change the statements in the edit buffer (remember to Verify your changes) and if you want to save your changes you have the choice of saving the ruleset as an XML document or as a source rule language file.
The following XML documents can be loaded into the editor and then viewed, changed and run from there:
Another example, SampleSensorEffector.java, is a simple Java program that makes use of a ruleset by the same name and demonstrates
This program can be run in two ways:
If you want to experiment with the program in this way, it is recommended that you copy the Java source file and the ruleset file to your own working directory. In the Java program, change (1) the package name and (2) the path which points to your copied ruleset file, and then compile and run the program. You can use use ABLE's runnit command as an example to make your own runnit for your new Java program.
Note that this new program will not show up on the Able Agent Editor's tabs. You can make it do so, however, but this is documented elsewhere. Without going into explicit details here, suffice it to say that (1) you will need a manifest file that states the program is a JavaBean, (2) you must package your new Java program in a jar file, and (3) you must add the jar file's name to an entry in the able.preferences file. Furthermore, your new program, like any JavaBean, will need BeanInfo and Customizer files; these are also provided as examples. You can make your customizer as simple or as complex as you wish -- the ruleset editor itself is actually just a JavaBean Customizer used by the Able Agent Editor, but a rather complex one!
Yet another example, Underwriting, is actually part of the ABLE tutorial and should be used in conjunction with that.