Open Source Toolkit Documentation:

Toy Travel Visualization Example

License / Documentation home / Help and feedback


Description

The core Communicator distribution contains a sample server configuration, called the toy travel demo, which is used in our tutorial and to illustrate a possible end-to-end system. The servers in the demo are configured via a data file which is a script of behaviors. Each server picks out its own response to a given input from the script.

This example differs from the toy travel demo in the core distribution in four ways:


Starting up

Unix

% <OSTK_HOME>/examples/toy_travel_visualization/script/toy_travel_visualization.csh

Windows

GC_HOME must be set in your environment. This command line assumes that OSTK is also set, and that Python is in your path.

C:\> python.exe %GC_HOME%\contrib\MITRE\tools\src\process_monitor\process_monitor.py %OSTK%\examples\toy_travel_visualization\script\toy-travel.config -- %GC_HOME%\contrib\MITRE\demos\toy-travel\example.frames %OSTK%\examples\toy_travel_visualization\script\toy-travel.pgm %OSTK%

On Windows, additionally, it's necessary to copy tt.properties.in to tt.properties and change the value of MF_OSTK to the root OSTK directory.


Running

Note that the hub visualization GUI may require JDK 1.4 in order to run reliably, especially on Windows. Keep in mind that the value of JDK_HOME that the process monitor uses is inherited from the core GCSI installation; if you need to change it to JDK 1.4, just modify the command line in the process monitor.

Start the servers in order. The last three servers are particularly interesting. Select "Controls -> Start Hub" in the Hub visualizer. The I/O monitor GUI will appear. The Hub changes to green, and seven servers appear. Note that some of these servers have icons or special screen names; this is handled in the PROPERTIES: list of the server declarations, as documented in the core distribution section about the Hub GUI API. Here's a sample service declaration from the program file which provides this functionality:
SERVER: Parser
HOST: localhost
PORT: 10000
OPERATIONS: Parse
PROPERTIES: :icon "DEMO_HOME/parse.gif" :screen_name "Toy Parser"
The identity of DEMO_HOME is handled in the properties file for the Hub visualizer.

Finally, a new menu is added to the menu bar, entitled "Send Message". This indicates that the add_menu_items message has been sent to the visualizer. This happens in the program file. The messages that are added control the delay between message dispatches in the Hub. The reason to introduce a delay is that the graphic visualization of the message traffic lags the message traffic itself if the messages are extremely fast. So we recommend selecting "Send Message -> 500ms pause".

Now, start the Audio server in the second process monitor. A new server will be displayed, and the greeting message traffic will display. As you move through the inputs by pressing "Input <return>" in the second process monitor, you'll see the message traffic illustrated and you'll see the inputs and outputs displayed in the I/O monitor GUI. When you reach the end of the inputs, the Audio server will shut down, and its icon will vanish from the Hub graphics pane.

You can also type into the I/O monitor GUI. Try a sentence that isn't in the toy travel script, like "I want to drive to Pittsburgh". It will reply that it didn't understand you, because the parser failed and the error capture is handled in the program file. Next, try a sentence which is in the script: "I want to fly to los angeles". This time you'll get the reply you got when you ran the Audio server.


License / Documentation home / Help and feedback

Last updated October 4, 2002