General Use

PrologClient.java is the Java wrapper that handles communication with the Glomus server; all messages from the server are passed along to the Prolog program for evaluation. This program should require no modification to work with any well-formed Prolog client as long as that client implements the required predicates (see the JavaProlog.pl program for a simple example Prolog client). By default, the Java Prolog client will use the Prolog code located in PrologClient.pl

PrologClient.pl is a simple Prolog implementation of a Glomus client. It plays a legal, though naive game of Glomus. This template can be used as the basis for building an intelligent player. It is important that the basic predicates required by the PrologClient.java program be present in one form or another. However, additional predicates can, and should be addedto increase the power of this player.

PrologClient.jar is a pre-compiled executable jar file that contains both the PrologClient.java program as well as the SWI-Prolog JPL classes. Users may find it easiest to simply use this program without recompiling the Java source; see notes below on use. Execute the jar file without options or arguments to get "usage" instructions.

The Prolog client is built using a stub Java-client (PrologClient.java) that integrates the SWI-Prolog engine via the SWI-Prolog/Java interface (JPL). In order to use this interface two things must be done:

Similarly, to execute the program we also need to include the JPL jar file in the class path:
% java -cp .:/usr/lib/pl-5.6.0/lib/jpl.jar Glomus/Client/Prolog/PrologClient

Alternatively, we can package the jpl code together with our client code in an executable jar as follows:

This directory includes a pre-packaged jar file that should work for most users without modification.

Client Information

JavaClient.java is a simple implementation of a Glomus client. This client plays a legal, though naive game of Glomus. This implementation is designed to be used as a template for building a more intelligent client. Portions of the code that we would expect to be enhanced are clearly marked. Execute this program without options or arguments to get "usage" instructions.

GUIClient.java is an applet that we use as an online demonstration. This implementation does not make a good template as it is rather hardwired and not designed for extensibility.

Protocol.java is a utility class that defines an enumeration based on the Glomus protocol for socket-based client-server communications. This class is used by both the clients and the Glomus server. It should not need any modification.

ServerConnection.java is a class that encapsulates socket-based communications with the Glomus server for Java Clients. It should not need any modification.

CmdLineParser.java is a utility class that simplifies parsing of command-line arguments

Note that the Glomus software has been developed as a package. To compile the Java Client for example, give the entire path of the package. E.g., from the directory holding the Glomus directory:
% javac Glomus/Client/Java/JavaClient.java

Similarly, give the entire class path to execute the client:
% java Glomus/Client/Java/JavaClient [options] [arguments]

Server Information

To compile the Server, give the entire path of the package. E.g., from the directory containing the Glomus directory:
% javac Glomus/Server/Server.java

Similarly, to execute the Server, give the entire path:
% java Glomus/Server/Server