Getting the RAP System


1. Getting the RAP Code

The code for the RAP system is available to universities and non-profit research institutions for educational and research purposes.

The RAP system code is written in vanilla Common Lisp and should run on any platform that supports Common Lisp. The code is available in two basic forms: the RAP system by itself, and the RAP system with the Truckworld simulator. Both forms contain exactly the same RAP code. However, getting the simulator allows running the RAP system "out of the box" to get a feel for the way it works, as well as seeing exactly how the system interfaces to the "outside."

In addition to coming with or without Truckworld, the RAP system also comes compressed in two forms: a compressed tar file for UNIX users and a compressed hqx file for Macintosh users. Hence, the RAP system is available via anonymous FTP in four different forms:

Any of these files can be retrieved by selecting the filename link, or by anonymous ftp to:

  ftp ftp.cs.uchicago.edu
  login: anonymous
  password: your email address
  cd pub/users/firby/code
  binary
  get the appropriate file
  quit

2. A Map of the RAP Code

Uncompressing any of the files retreived above will create the series of directories shown below. If just the RAP system is retreived only the bold directories will be built. If Truckworld is brought over too, all directories will be built.

RAP System directory structure picture.

The three directories under the rap-system each contain a different part of the code:

BASIC
The basic directory contains code that is used throughout the RAP system. In some sense it is a library.
MEMORY
The memory directory contains the code that implements the RAP memory system, including the code that manages expectation sets.
INTERPRETER
The interpreter directory contains the code for the RAP system proper. It includes code to manage the task agenda, create new tasks, expand RAP task nets, and generally do what the RAP system does.

The files and directories under the truckworld-raps directory include the code for:

INTERFACE Files
The interface files contains the code used to connect the RAP system with the Truckworld simulator. Basically, these files contain declarations for mapping RAP primitives into Truckworld domain calls. This code is typically not very involved and it needs to be changed when the RAP system is used in a different domain.
RAPS
The RAPS directory contains the RAPs and supporting memory declarations used for the Truckworld examples. This code contains declarations for the memory systems, routines for mapping sensor data into memory changes, and the actual RAPs used in the examples.
EXPERTS
The experts directory contains problem solvers that can be called in specific situations when a RAP does not have an applicable method. In Truckworld, only a single route planning expert is used.

3. Getting the RAP System Running

Whichever form of the RAP system is retrieved, the top-level directory will contain a file called loader.lisp. This file will need to be edited to reflect the appropriate top-level pathname. Directions are included in the file. Similarly, the directories rap-system and truckworld-classic will contain loader.lisp files. These files do not need to be altered if the top-level loader file is changed correctly (of course, if the rap-system directory is the top-level, it's loader file will be the one changed).

After the pathnames in the appropriate loader.lisp file have been changed, start up your favorite Common Lisp and load the loader file. The loader file will define a number of functions that can be used to load and compile the rest of the system.

3.1 Loading the RAP System

The loader file for the RAP system will define the following functions:
(load-rap-system)
This function loads all of the files making up the basic RAP system. This includes everything in the basic, memory, and interpreter directories. Nothing is loaded from the interface directory because that code needs to be changed with the RAP system's environment.
(compile-rap-system)
This function will compile everything in the basic RAP system.
(load-rap-knowledge)
This function loads the files in the interface directory supplied. These files define the interface to Truckworld and should only be taken as an example. The load-rap-knowledge function will need to be ignored or rewritten once the RAP system is embedded in a new environment.

To get things ready to go, execute the function (load-rap-system). This function will load a large number of files and define the basic RAP system. You will then be able to define memory predicates, functions, and item properties. You will also be able to define the RAPs required for your domain, and the low-level interface functions needed for the RAP system to carry out primitive actions. Look in the supplied interface directory for examples of this sort of domain knowledge.

3.2 Loading the RAP System with Truckworld

The loader file in the rap-world directory will define the functions described above as well as:
(load-everything)
This function loads all of the files making up the basic RAP system, the files defining the Truckworld simulator, and the files that form the interface between the two. This includes a whole suite of example RAPs for Truckworld.
(compile-everything)
This function will compile everything in the basic RAP system and Truckworld.
(run-example)
This function will create a Truckworld world and run the RAP system through its paces trying to fulfill a small set of rock orders.

To get things ready to go, execute the function (load-everything). This function will first load Truckworld, then the basic RAP system and finally the files in the supplied interface directory that connect the two. The more specific (load-rap-system) and (load-rap-knowledge) functions do not need to be called directly.

It is recommended that everything be compiled before the rock example is run. That example can take up to twenty minutes to complete depending on the type of computer being used. The rock order example is discussed in more detail in A Truckworld Example.

4. More Information

Once the RAP system has been successfully loaded, see the following documents for further information:
CS Home AI Home AI Projects RAPs Firby
Getting the RAP System / R. James Firby / firby@cs.uchicago.edu
March, 1995