Basic Cougaar Demos

This is the README.html file from the cougaar_demo.zip.


README.html

This zip file contains the Cougaar required configuration and source code for the Cougaar "hello world" and "ping" demos.

For additional information, see the Cougaar Overview Slides:
  http://cougaar.org/docman/view.php/17/196/CougaarOverview.ppt.

Index:


Contents:

  1. configs/hello/*.xml:
    The society and runtime files for the "hello world" demo.
  2. configs/ping/*.xml:
    The society and runtime files for the "ping" demos.
  3. lib/hello.jar:
    Compiled "hello world" source code. The compiled "ping" code is included in the Cougaar release.
  4. src/org/cougaar/demo/hello/HelloPlugin.java:
    Java source code for the "hello world" demo.
  5. Ping source code:
    The Java source code for the "ping" demo is included in the "cougaar-src.zip" download, or available online:
  6. build.xml:
    Optional Ant script to recompile the "hello world" code.

Installation:

  1. Verify that Java 1.5 or 1.6 is installed and on the PATH, by running:
      java -version
  2. Download Cougaar 12.2 or later. The 12.2 release can be found at:
      http://cougaar.org/frs/?group_id=17&release_id=132
    Or download the latest nightly build from:
      http://build.cougaar.org/auto/HEAD/latest_success/
  3. Create a Cougaar install directory, e.g.:
      mkdir /usr/local/cougaar
    Optionally this directory can be shared and read-only.
    Set this directory as the COUGAAR_INSTALL_PATH environment variable:
      export COUGAAR_INSTALL_PATH=/usr/local/cougaar
  4. Unzip the "cougaar.zip" and "cougaar-support.zip" into the COUGAAR_INSTALL_PATH.
  5. Optionally add the "$COUGAAR_INSTALL_PATH/bin/cougaar" script to the command-line search PATH:
      export PATH=$COUGAAR_INSTALL_PATH/bin:$PATH
  6. Create a per-user Cougaar society directory for this demo, e.g.:
      mkdir ~/cougaar Set this directory as the COUGAAR_SOCIETY_PATH environment variable:
      export COUGAAR_SOCIETY_PATH=~/cougaar
  7. Unzip this cougaar_demo.zip file into the COUGAAR_SOCIETY_PATH.
  8. If the COUGAAR_INSTALL_PATH is a read-only directory, copy the Tomcat config files into the COUGAAR_SOCIETY_PATH:
      cp -r $COUGAAR_INSTALL_PATH/webtomcat $COUGAAR_SOCIETY_PATH
    This is a workaround for bug 3908:
      http://bugs.cougaar.org/show_bug.cgi?id=3908
  9. Optionally recompile the "hello world" demo code:
      ant dist

Usage:

There are five example use cases:
  1. The "hello world" demo:
    1. Run:
        cd $COUGAAR_SOCIETY_PATH/configs/hello
        cougaar HelloSociety.xml HelloRuntime.xml
      This should print:
        [HelloPlugin] - A: Hello, world!
    2. To stop the run, press "CTRL-C".
  2. A basic "ping" test:
    1. Run:
        cd $COUGAAR_SOCIETY_PATH/configs/ping
        cougaar PingBasicSociety.xml PingBasicRuntime.xml
      This should print:
        [PingSender] - A: Sending ping 0 to B
        [DOTS] - +-
        [PingReceiver] - B: Responding to ping 0 from A
        [DOTS] - +-
        [PingSender] - A: Received response 0 from B
        [PingSender] - A: Will send ping 1 to B in 5 seconds
        [DOTS] - .
        ...
    2. Optionally view the servlet at
        http://localhost:8800/$A/ping
    3. Press CTRL-C to stop the run.
  3. A two-node "ping" test:
    1. In one console window, run:
        cd $COUGAAR_SOCIETY_PATH/configs/ping
        cougaar PingTwoNodesSociety.xml PingTwoNodesRuntime.xml Node1
    2. In a second console window, run:
        cd $COUGAAR_SOCIETY_PATH/configs/ping
        cougaar PingTwoNodesSociety.xml PingTwoNodesRuntime.xml Node2
    3. The output should match the output of the single-node ping test. There may be a startup delay of up to a minute, due to the naming service.
    4. Press CTRL-C to stop the run.
  4. A two-host "ping" test:
    1. Modify the PingTwoNodesRuntime.xml to change the host name from "localhost" to the host that will run "Node1".
    2. Perform the same steps as in the two-node test.
  5. A single-node "ping" benchmark:
    1. Run:
        cd $COUGAAR_SOCIETY_PATH/configs/ping
        cougaar PingBenchmarkSociety.xml PingBenchmarkRuntime.xml
      Note that the above runtime XML file has been modified to disable the logging output.
    2. Optionally view the servlet at
        http://localhost:8800/$A/ping
      Note the high "pings-per-second" throughput, due to the below "delayMillis=0" setting.
    3. Optionally view the metrics servlets, e.g.:
        http://localhost:8800/metrics/agent/load
      For a full listing of included metrics servlets, see:
        doc/OnlineManual/MetricsService/operation.html
    4. Press CTRL-C to stop the run.

Support:

If you have questions or comments, please:
  1. Subscribe to the cougaar-developers mailing list:
      http://cougaar.org/mailman/listinfo/cougaar-developers
  2. Then send email to:
      cougaar-developers@cougaar.org