Jess
Jess
Dateline: 04/25/00
There are very strong reasons to use higher level cognitive processing techniques in many types of applications, especially mobile agents. Despite the hype surrounding the subject and people talking only about about what agents should do, without any real examples, the technology is slowly taking off. Although there are successful applications of evolutionary and connectionist techniques for search, retrieval and negotiation tasks on the Web, expert system shells will probably be the tool for constructing the reasoning part of your next mobile agent project. After all, we are dealing with symbolic information here, and the application of expert systems to a wide range of problems is still one of the most useful technologies to emerge from AI research.
With the choice of particular AI technique behind us, we can concentrate on a specific tool. Some of the high-level expert system development tools are described in previous articles, but one candidate stands out because of its simplicity, public acceptance and support. Jess (Java Expert System Shell), created by by Ernest Friedman-Hill at Sandia National Laboratories, is a "close relative" of the most popular expert system shell known as CLIPS and implemented at NASA. CLIPS itself is a C implementation of the OPS5 language, developed by Charles Forgy, Carnegie Mellon University. As OPS5 is written in, and available in, various dialects of LISP, Jess programs have entirely different structure from Java programs. So, you'll have to overcome the "oh no, not another programming language" effect, but after a short while you'll be able to deal with large ill-structured problems for which it is difficult to develop detailed functional algorithms in languages like Java. On the other hand, you'll have the complete Java arsenal at you disposal, as it can directly access all Java classes and libraries. For this reason, Jess is also frequently used as a dynamic scripting or rapid application development environment. While Java code generally must be compiled before it can be run, a line of Jess code is executed immediately upon being typed. This allows you to experiment with Java APIs interactively, and build up large programs incrementally. It is also very easy to extend the Jess language with new commands written in Java or in Jess itself, and so the Jess language can be customized for specific applications. And best of all, it is freely available, with complete source code only a mouse click away.
The main concept you'll get used to when using Jess is a production rule. The most general form of a production rule is
<left-hand side> => <right-hand side>
As you will see, this system models stimulus-response behavior in humans: the left-hand side (LHS) represents data that triggers a response represented by the right-hand side (RHS). If the expert system starts with the facts that are matched to the LHS it is called a forward chaining system; otherwise, starting with desired goal states that are matched to the RHS gives us a backward chaining system. Jess now supports both approaches. Jess's rule engine uses an improved form of a well-known algorithm called Rete to match rules against the knowledge base. Jess is actually faster than some popular expert system shells written in C, especially on large problems, where performance is dominated by algorithm quality.
Going a step further from a stimulus-response behavior and supporting more complex decision making abilities will require higher-level control functionality, which is also fairly easy to implement in Jess. However, every expert system works best only in a narrow problem domain, so don't expect too much from your first applications.
For those among you wanting to quickly learn basic concepts of intelligent mobile agents, there is a clean and simple learning tool: Ki for JavaWorld is an implementation of a subset of the Ki, a state-of-the-art mobile agent architecture designed to address problems that appear frequently in dynamic distributed applications. Created by Todd Sundsted and available under the GNU General Public License (GPL), Ki for JavaWorld comes in two flavors - one with Jess included as part of the distribution, and one without. As good things come in small packages, the biggest distribution file is smaller than 0.5 MB. However, these distributions include only one agent, you should download one or more of the tutorial collections.