This example is a simple elevator system. It consists of two agents:
- Elevator User Interface agent, which interacts with the users
of the systems by allowing them to press call buttons on the floors.
It also shows the movement of the elevator, the opening and closing
of the elevator doors under control of the second agent, Elevator
Controller. UI agent is written in Java.
- Elevator controller agent, which controls the elevator system.
It tries to serve the floors by moving the elevator in the optimal
way. This agent is written in IndiGolog.
The system works like this: when a user presses a call button on some
floor, the UI agent notifies the Elevator controller agent of the
changes in the status of call buttons. Elevator Controller agent plans
the movements of the elevator so as to minimize its motion while serving
requested floor(s). Once the plan is found and executing, another
user may call the elevator to a different floor. This will result
in replanning.
Details
of the Agents

The Elevator User Interface agent has the following procedure solvables
registered with the facilitator:
- on(floor) turns on the call button on a floor
- off(floor) turns off the call button on a floor
- buttons_status(List) returns a list of one's and zero's,
one meaning that the call button is on and zero meaning that it
is off. Mainly used for debugging purposes.
- up moves the elevator one floor up. Fails if the elevator
is currently on top floor.
- down moves the elevator one floor down. Fails if the
elevator is currently on the first floor.
- current_floor(Floor) returns the current floor the elevator
is on.
- open_doors(Floor) opens the doors on the specified floor.
Succeeds only if the elevator is currently on the specified floor.
- close_doors(Floor) close the doors on the specified floor.
This is a screen shot of the Elevator UI agent with the elevator
being on the first floor and ready to serve floors 3 and 5.

The Elevator Controller agent has just one solvable declared:
- update_buttons(Vector) this is used by the Elevator
UI agent to send updates on the status of the call buttons.
To run the sample system, launch the facilitator, Elevator Controller
agent, and UI agent (the main application class is UI.java). To call
the elevator to any floor, click on the corresponding arrow and watch
it serve that floor.
Compiling
Java agents
Before compiling the system make sure that the facilitator agent is
running and you have the updated setup.pl file either in the current
directory, or in the root of your C drive (Windows), or in your home
directory (Unix).
We have provided a batch file and a shell script files for easy compilation
of this example system under Windows and Unix. The scrips assume that
you have Java OAA library (oaa2.jar file) in the directory together
with the source code for this system. Run the script file corresponding
to your operating system and simply follow the instructions.
See this page for instructions on
compiling IndiGolog agents.
Source Code

|