Open Source Object Oriented Distributed Simulation Framework
Overview of The RToolkit
The RToolkit is an open source, cross platform, object-oriented C++ framework for HLA compliant simulation development. It provides an abstract design for developers in order to decrease HLA federate development efforts and increase software quality by utilizing systematic reuse. The framework simplifies complex RTI API and provides a standard functionality for common RTI related tasks as well as extension points to implement federate specific behavior. With the RToolkit, it is possible to develop federates conforming both of the current HLA standards or to adapt existing ones to current or future HLA standards without changing simulation code. The framework is FOM agile and can be easily customized to adopt federates to different FOMs.
The RToolkit has a layered architecture with three different layers. These are RTI Adaptation, Core RTI Service and Federate Extension layers, as depicted in Figure 1.
Figure 1. Layered Architecture of RToolkit.
RTI Adaptation Layer
Protects upper layers of framework from RTI API differences due to HLA Interface Specifications. This layer implements a wrapper facade class to encapsulate different versions of RTIambassador functions. Classes on the upper layers of the framework calls functions of wrapper facade class instead of calling RTIambassador's functions directly. By this policy, HLA standard used for the federation becomes transparent to upper levels of the RToolkit.
Core RTI Service Layer
Includes common RTI and auxiliary services required by almost all HLA federates. This layer is mostly used by the Federate Extension layer and can be customized according to federate requirements by using the Federate Extension layer. Core RTI Service Layer also includes classes to implement auxiliary services that are not supported by HLA standard and RTI implementations. These services are:
Object and interaction creator factories that are customizable by the user;
Object tracking and management;
Parsers to collect startup parameters for the federate;
Encoders and decoders for data marshaling and de-marshaling;
Multilevel logging and tracing.
Federate Extension Layer
Provides FOM agility and extension points for federate developers to incorporate federate specific behavior to framework. There are two distinct extension methods within the RToolkit. The first method is subclassing of base types implemented in the framework for FOM agility. Federate developers derive federate specific simulation object and interaction classes from corresponding base classes and implements related encoder and decoder functions for data exchange. The second extension method is the registration of event based callbacks that are called by the framework when a predefined event occurs. Rather than using conventional unsafe callback mechanism, the RToolkit implements Observer Pattern with signals and slots construction for type safety and flexibility.
These are the required libraries for RToolkit:
Extract the source code under a directory and run command below
$ cd rtoolkit-xx.yy
You should define appropriate variables while running cmake to produce Makefiles in accordance with the HLA standard. The command given below will produce both versions of the library with debug symbols:
$ cmake -DHLA1516:BOOL=ON -DHLA13:BOOL=ON -DDEBUG:BOOL=ON.
Than you can compile the framework ant test federates:
And then you can install the library to $HOME/rtoolkit-<release_number> with the command:
$ make install
Add $HOME/rtoolkit-<release_number>/lib path to LD_LIBRARY_PATH environment variable. To run tests, you should run the RTI first. Script files are supplied to run test federates.
Compiling with The RToolkit
To compile federates developed with the RToolkit add include paths and library paths of all dependencies and the corresponding rtoolkit shared library and include files. Libraries and preprocessor directives to compile for a particular RTI version are as follows:
Copyright 2008 Hakan Savaşan