The dTank/Jess API is a Java library that makes it possible to write intelligent tanks for dTank using Jess. This library adds several custom functions to Jess that allow Jess agents to control a running dTank. The dTank/Jess API was created by Mark Cohen, an Instructor in the Business Adminstration, Computer Science, and Information Technology Department at Lock Haven University.
Jess is a tool for building expert systems. Jess was written by Ernest Friedman-Hill at Sandia National Laboratories and is available at no cost for academic use. A special academic license must be obtained by contacting Sandia's Technology Transfer Office. For more information about Jess, and details about how to obtain an academic license see the Jess website.
Installing the interface is easy. Create a directory named dTankJess and extract the contents of the dTankJess.zip file into this directory. This will create the following folder hierarchy:
dist - the dTankJess jarfile and the dTankJess zipfile. docs - the API documentation examples - example Jess programs that demonstrate how to drive a tank src - all the source code
There are currently two examples located in the examples subfolder:
To run either of these examples you first must execute Jess, making sure that the dTankJess jarfile is in Jess's classpath. For example, assuming the Jess jarfile is installed in \jess and the current directory is the dTankJess installation folder, the following command will execute Jess so that it can find the dTankJess interface library:
java -classpath \jess\jess.jar;dist\dTankJess.jar jess.Main
Once Jess has been started, the next step is to execute a dTank server. See the dTank website for instructions on how to run a dTank server.
With Jess and dTank running, you are now in a position to test out one of the examples. You can use the Jess "batch" command to load either example. From the Jess command line shell type one of the following two commands:
(batch examples\FactFinder.clp) (batch examples\SimpleTank.clp)
The best way to discover the facts that are made available to Jess by this interface is to run the FactFinder.clp example. This Jess program will print the facts as they are added to the knowledge base by the dTank server. To see all the facts, create a human tank and move it into the visual range of the Jess tank. As soon as the Jess tank sees the human tank, additional facts will be added to the knowledge base, and printed on the screen.
It is important to realize that as information is received from the server, all old facts are retracted, before new facts are asserted. This means that even if the x location of the tank did not change, the fact that represents the x location will be retracted and reasserted in the Jess knowledge base.
This current implementation is limited by the fact that it only records visual and status messages received from the dTank server. All other dTank server messages are ignored. Future versions of this interface will support all of the dTank messages.