org.npsnet.xrti.tests
Class HelloWorld

java.lang.Object
  extended byorg.npsnet.xrti.tests.HelloWorld
All Implemented Interfaces:
HelloWorldInteractionListener

public class HelloWorld
extends java.lang.Object
implements HelloWorldInteractionListener

A simple test of the XRTI.

Author:
Andrzej Kapolka

Constructor Summary
HelloWorld(java.util.Properties configuration, java.lang.String name, double initialPopulation, int numberOfTicks)
          Constructor.
 
Method Summary
static void main(java.lang.String[] args)
          Program entry point.
 void receiveCommunication(java.lang.String message, byte[] userSuppliedTag, OrderType sentOrdering, TransportationType theTransport)
          A generic message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HelloWorld

public HelloWorld(java.util.Properties configuration,
                  java.lang.String name,
                  double initialPopulation,
                  int numberOfTicks)
Constructor.

Parameters:
configuration - the list of configuration properties
name - the name of the country to simulate
initialPopulation - the country's initial population
numberOfTicks - the number of ticks to execute
Method Detail

main

public static void main(java.lang.String[] args)
Program entry point.

Parameters:
args - the command line arguments

receiveCommunication

public void receiveCommunication(java.lang.String message,
                                 byte[] userSuppliedTag,
                                 OrderType sentOrdering,
                                 TransportationType theTransport)
                          throws InteractionClassNotRecognized,
                                 InteractionParameterNotRecognized,
                                 InteractionClassNotSubscribed,
                                 FederateInternalError
A generic message.

Specified by:
receiveCommunication in interface HelloWorldInteractionListener
Parameters:
message - The contents of the message.
userSuppliedTag - a user-supplied tag associated with the interaction
sentOrdering - the type of ordering with which the interaction was sent
theTransport - the type of transport associated with the interaction
Throws:
InteractionClassNotRecognized - if the interaction class was not recognized
InteractionParameterNotRecognized - if a parameter of the interaction was not recognized
InteractionClassNotSubscribed - if the federate had not subscribed to the interaction class
FederateInternalError - if an error occurs in the federate