Short Applet Overview

This short overview is only a glimpse at the whole applet, of course. However, all of the most important classes and concepts are mentioned. All classnames are written bold the first time.

Basic class hierarchy

The main class is called World. World gets things running and keeps them running. It will first initialise the applet by reading the HTML parameters and creating all environments. Then it provides the user interface and calls upon the environments to proceed one simulation step whenever necessary.

In World, the Environments are stored. There is an abstract Environment superclass which will allow World to run any type of round by round simulation. This way, there can be several very different Environments in one World, running concurrently. Each Environment gets parameters World took from the HTML files and parses them to initialise itself.

In Wumpus-like Environments (two-dimensional grid environments), a grid of Fields represents the environment area. Inside these Fields, the FieldObjects are stored. There are PassiveFieldObjects (like gold) simply lying around, and ActiveFieldObjects. They represent anything in the simulation are which will do something on its own. A perfect example for this would be an agent.

Again, there is a uniform interface to provide communication between the Environment class and the ActiveFieldObject. Environments prepare Percepts and give them to the ActiveFieldObjects. Those evaluate them with whatever logic they have implemented, and return the Actions they wish to perform.

The graphic system

Java is quite restricting on who draws anything. However, in this applet, almost everyone is allowed to draw himself. To enable this, (almost) everyone gives drawing areas to those classes which are to display themselves in his own drawing area.

World arranges the Environments on display and provides them with their own Graphics objects (used for drawing in Java programs). The Environments give the Fields their drawing areas. Finally, the Fields draw everything inside themselves using the FieldObjects draw(..) functions.

This system allows everyone to draw himself, without having to change the whole drawing system. A Resourceloader class provides everyone with whatever images (or, in the future, sounds or other resources) are needed.


Navigation:


Last modified June 97