Java(tm) Agent Template, Version 0.3

Example 2: The remote service specialization.


The agents provided in the base JAT packages (Agent and ANS) are not intended to be used as-is, but should be subclassed to provide some specific functionality. The JAT_0.3 distribution includes an example JAT specialization which supports the use of remote services, managed by ServiceAgents, by a distributed group of ClientAgents. The implementation for this remote service architecture is contained in the RemoteService packages. A ServiceBroker agent (ANS) serves as a repository for registered services, in addition to its normal duties as an ANS. Each ServiceAgent, when started, will register the group of services it manages with the ServiceBroker. ClientAgents, when started, automatically retrieve the list of available services from the ServiceBroker. Each available service can be installed and executed by a ClientAgent via interaction with the ServiceAgent. This architecture is generic and can support a wide range of applications which can be represented by the remote service paradigm.

This example utilizes the agents in the RemoteService package to demonstate the registration, delivery and use of a sample remote service, the Fixture Design and Analysis Tool (FDAT). The analysis portion of this service was developed by CMU and is maintained on their network. I initially developed the Java interface (FDATI) as an applet but decided that it would make a "cool" example so reworked the code into a Service subclass. The FDAT provides stability analysis for a set of motion constraints, or fixtures, on a solid. Check out FDATI pages for more info. Basically, the interface will display a solid model which the user can rotate, zoom and pan. Shift-clicking on the solid will add fixture points. When the user feels like they have a stable plan they can submit the fixture information to a cgi-bin script at CMU which interfaces with the analysis code.


Here is what you need to do:

  1. Make certain you have modified the appropriate scripts/html files.
  2. Start a ServiceBroker by executing the "broker" script. This agent has a specialized GUI with widgets for displaying available services. Note: this GUIdoes not directly display the system messages; you must click on the "System Messages" button to see the messages.
  3. Start a FDATAgent by executing the "FDAT" script. A thumbnail representing the FDAT service should be displayed in the "Services" canvas. If you click on this icon, a description of the Service will appear below. This service will be automatically registered with the ServiceBroker.
  4. Start a ClientAgent by executing the "client" script. This agent will automatically retrieve the available service from the broker. At this point you should have three agents with the FDAT service icon displayed in each GUI.
  5. Double-click on the FDAT icon in the ClientAgent GUI. This will install and execute the FDATService object. You should now see a top-level window representing the FDATService. Select one of the three example models and press the "Display Model" button. You should now see a separate top-level window which displays the selected solid. Dragging the mouse across the screen will rotate the solid, shift clicking on the solid will add fixture points. You can also zoom, pan and change the display settings. Go ahead and try to design a stable fixturing plan for one of the parts. When you are finished creating the fixturing plan, click on the submit button. Submission results will be shown in a top level window.


OK, now here's how all of that actually happened:


frost@cdr.stanford.edu