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:
- configs/hello/*.xml:
The society and runtime files for the "hello world" demo.
- configs/ping/*.xml:
The society and runtime files for the "ping" demos.
- lib/hello.jar:
Compiled "hello world" source code. The compiled "ping" code is included in the Cougaar release.
- src/org/cougaar/demo/hello/HelloPlugin.java:
Java source code for the "hello world" demo.
- Ping source code:
The Java source code for the "ping" demo is included in the "cougaar-src.zip" download,
or available online:
- build.xml:
Optional Ant script to recompile the "hello world" code.
Installation:
- Verify that Java 1.5 or 1.6 is installed and on the PATH, by running:
java -version
- 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/
- 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
- Unzip the "cougaar.zip" and "cougaar-support.zip" into the
COUGAAR_INSTALL_PATH.
- Optionally add the "$COUGAAR_INSTALL_PATH/bin/cougaar" script to the
command-line search PATH:
export PATH=$COUGAAR_INSTALL_PATH/bin:$PATH
- 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
- Unzip this cougaar_demo.zip file into the COUGAAR_SOCIETY_PATH.
- 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
- Optionally recompile the "hello world" demo code:
ant dist
Usage:
There are five example use cases:
- The "hello world" demo:
- Run:
cd $COUGAAR_SOCIETY_PATH/configs/hello
cougaar
HelloSociety.xml
HelloRuntime.xml
This should print:
[HelloPlugin] - A: Hello, world!
- To stop the run, press "CTRL-C".
- A basic "ping" test:
- 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] - .
...
- Optionally view the servlet at
http://localhost:8800/$A/ping
- Press CTRL-C to stop the run.
- A two-node "ping" test:
- In one console window, run:
cd $COUGAAR_SOCIETY_PATH/configs/ping
cougaar
PingTwoNodesSociety.xml
PingTwoNodesRuntime.xml
Node1
- In a second console window, run:
cd $COUGAAR_SOCIETY_PATH/configs/ping
cougaar
PingTwoNodesSociety.xml
PingTwoNodesRuntime.xml
Node2
- 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.
- Press CTRL-C to stop the run.
- A two-host "ping" test:
- Modify the
PingTwoNodesRuntime.xml
to change the host name from "localhost" to the host that will run "Node1".
- Perform the same steps as in the two-node test.
- A single-node "ping" benchmark:
- 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.
- Optionally view the servlet at
http://localhost:8800/$A/ping
Note the high "pings-per-second" throughput, due to the below
"delayMillis=0" setting.
- 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
- Press CTRL-C to stop the run.
Support:
If you have questions or comments, please:
- Subscribe to the cougaar-developers mailing list:
http://cougaar.org/mailman/listinfo/cougaar-developers
- Then send email to:
cougaar-developers@cougaar.org