Example Federates Using Portico

Please note that all example federates are shipped with Portico and are available in the "examples" directory. Included here are helper scripts and batch files to build and execute the example federates for each platform. To find out more about the setting required to compile the federates, look inside those batch files/scripts.

The Example Federate
The example federate is designed to demonstrate how to:


 * 1) Publish and Subscribe
 * 2) Register and delete an object
 * 3) Update attribute values
 * 4) Send an interaction
 * 5) Advance time
 * 6) Use synchronization points

The federate starts up and after going through setup (publication and subscription, enabling time regulation and constrained etc...) it advances time from 1-10 in 1.0 increments. Each step it will update the attributes of an object it has registered and will send an interaction. When it receives a reflection or an update, it will log this information to screen.

You can run multiple instances of the example federate at once by starting each with a different name. This is useful to see that all federates are communicating with one another. If they are, you should be print-outs for the information received by each federate from the others.

Compiling the Federate
Each federate comes with helper scripts to do this for you. Note that if you are using Java you must have JAVA_HOME set and javac must be available from the command line. If you are using C++, your compiler must be available from the command line.

To compile the examples, invoke the appropriate script with the "compile" argument:

win32 compile

Running the Federate
As with compiling, if you are using Java you must have JAVA_HOME set and "java" available from the command line. You can also set RTI_HOME if you want.

To run the example federate, use the appropriate script:

win32 execute [federateName]

The "federateName" argument is optional. If you are running more than one federate at once, make sure you give each of them different names.

Example Federate Code
The code for each of the example federates is provided here:

Example HLA1.3 Java Federate

Example Java1 Java Federate (rti-ng compatible)

Example HLA1.3 CPP Federate (rti-ng compatible)

Example 1.3 FED File (used in 1.3 example federates)