diff -U 3 -H -d -r -N -x 'install/*' -x 'build/*' -- original/applications/HLA_TestsSuite/BCVMTest.fed cvsrep/applications/HLA_TestsSuite/BCVMTest.fed
--- original/applications/HLA_TestsSuite/BCVMTest.fed	1970-01-01 03:00:00.000000000 +0300
+++ cvsrep/applications/HLA_TestsSuite/BCVMTest.fed	2011-02-25 13:23:13.000000000 +0300
@@ -0,0 +1,26 @@
+;; BCVMTest
+
+(Fed
+  (Federation BCVMTest)
+  (FedVersion v1516)
+  (Federate "bcvm" "Public")
+  (Federate "terminal" "Public")
+  (Spaces
+  )
+  (Objects
+  )
+  (Interactions
+    (Class InteractionRoot RELIABLE RECEIVE
+      (Class bcvmMessage RELIABLE TIMESTAMP
+        (Sec_Level "Public")
+          (Parameter bcvmX)
+          (Parameter bcvmId)
+      )
+      (Class terminalMessage RELIABLE TIMESTAMP
+        (Sec_Level "Public")
+          (Parameter terminalX)
+          (Parameter terminalId)
+      )
+    )
+  )
+) 
diff -U 3 -H -d -r -N -x 'install/*' -x 'build/*' -- original/applications/HLA_TestsSuite/CMakeLists.txt cvsrep/applications/HLA_TestsSuite/CMakeLists.txt
--- original/applications/HLA_TestsSuite/CMakeLists.txt	2011-02-17 18:12:42.000000000 +0300
+++ cvsrep/applications/HLA_TestsSuite/CMakeLists.txt	2011-02-26 19:35:09.446124001 +0300
@@ -75,7 +75,12 @@
 FIND_PACKAGE(RTI REQUIRED)
 INCLUDE_DIRECTORIES(${RTI_INCLUDE_DIR})
 ADD_DEFINITIONS(${RTI_DEFINITIONS})
-find_library(LIBHLA NAMES HLA HLAd)
+
+FIND_LIBRARY(LIBHLA
+  NAMES HLA HLAd
+  PATHS $ENV{CERTI_HOME}
+  PATH_SUFFIXES lib Debug Release
+  DOC "The libHLA Library")
 
 #########################################################################
 # CPack specific Configuration
@@ -201,6 +206,21 @@
                       COMMENTS "A FOM parsing test"
                       )
 #########################################################################
+# ADD TEST BCVMTest
+#########################################################################
+HLATestsSuite_ADD_TEST(BCVMTest_bcvm
+                      FED_FILE BCVMTest.fed
+                      SOURCE_FILES federate.cpp bcvm.cpp
+                      COMMENTS "creates bcvm"
+                      HLA1516)
+
+HLATestsSuite_ADD_TEST(BCVMTest_terminal
+                      FED_FILE BCVMTest.fed
+                      SOURCE_FILES federate.cpp terminal.cpp
+                      DTEST_SCRIPT dtest_ping_pong.py
+                      COMMENTS "creates terminal"
+                      HLA1516)
+#########################################################################
 # IEEE-1516 unit and integration tests 
 #########################################################################
 HLATestsSuite_ADD_TEST(01-FederationExecutionTest 
diff -U 3 -H -d -r -N -x 'install/*' -x 'build/*' -- original/applications/HLA_TestsSuite/bcvm.cpp cvsrep/applications/HLA_TestsSuite/bcvm.cpp
--- original/applications/HLA_TestsSuite/bcvm.cpp	1970-01-01 03:00:00.000000000 +0300
+++ cvsrep/applications/HLA_TestsSuite/bcvm.cpp	2011-02-27 14:27:26.000000000 +0300
@@ -0,0 +1,196 @@
+#include <iostream>
+#include <string>
+#include <limits>
+
+#include "bcvm.h"
+
+// #define DISABLE_TIME_MANAGEMENT
+
+BCVM::BCVM(std::wstring _federatoinName, std::wstring _fddName)
+: Federate( L"BCVM", _federatoinName, _fddName) {
+}
+
+void BCVM::getHandles() {
+	// Interaction class handles
+	out << "getting handle for interactions..." << std::endl;
+	bcvmMessageH = rtiamb->getInteractionClassHandle( L"bcvmMessage" );
+	terminalMessageH = rtiamb->getInteractionClassHandle( L"terminalMessage" );
+	out << "succeeded." << std::endl;
+	
+	// Parameter class handles
+	out << "getting handle for interaction parameters..." << std::endl;
+	bcvmXH = rtiamb->getParameterHandle( bcvmMessageH, L"bcvmX" );
+	bcvmIdH = rtiamb->getParameterHandle( bcvmMessageH, L"bcvmId" );
+	terminalXH = rtiamb->getParameterHandle( terminalMessageH, L"terminalX" );
+	terminalIdH = rtiamb->getParameterHandle( terminalMessageH, L"terminalId" );
+	out << "succeeded." << std::endl;
+
+ 	bcvmMessageMap.insert(std::make_pair( bcvmXH, any2var(terminalX) ));
+	bcvmMessageMap.insert(std::make_pair( bcvmIdH, federateHandle.encode() ));
+}
+
+/*! Initialises BCVM
+ * \msc
+ * BCVM,Federate,RTI;
+ * BCVM=>Federate [label="subscribeWrapper"];
+ * Federate=>RTI [label="subscribeInteractionClass"];
+ * Federate<<RTI;
+ * BCVM<<Federate;
+ * BCVM=>Federate [label="publichWrapper"];
+ * Federate=>RTI [label="publishInteractionClass"];
+ * Federate<<RTI;
+ * BCVM<<Federate;
+ * BCVM=>Federate [label="enableConstrainedModeWrapper"];
+ * Federate<<RTI;
+ * ...;
+ * --- [label="waiting for corresponding callback"];
+ * Federate=>RTI [label="evokeCallback"];
+ * Federate=>RTI [label="enableTimeConstrained"];
+ * Federate<-RTI [label="timeConstrainedEnabled"];
+ * Federate>>RTI;
+ * Federate<<RTI;
+ * BCVM<<Federate;
+ * BCVM=>Federate [label="enableRegulationModeWrapper"];
+ * Federate<<RTI;
+ * ...;
+ * --- [label="waiting for corresponding callback"];
+ * Federate=>RTI [label="evokeCallback"];
+ * Federate=>RTI [label="enableTimeRegulation"];
+ * Federate<-RTI [label="timeRegulationEnabled"];
+ * Federate>>RTI;
+ * Federate<<RTI;
+ * BCVM<<Federate;
+ * \endmsc
+ */
+void BCVM::customInit() {
+	subscribeWrapper( terminalMessageH );
+	publishWrapper( bcvmMessageH );
+	#ifndef DISABLE_TIME_MANAGEMENT
+	lookahead = 10;
+	enableConstrainedModeWrapper();
+	enableRegulationModeWrapper();
+	#endif
+}
+
+/*! Main BCVM simulation loop.
+ * \msc
+ * BCVM,Federate,RTI;
+ * BCVM=>Federate [label="nextMessageWrapper"];
+ * Federate=>RTI [label="nextMessageRequest"];
+ * Federate<<RTI;
+ * BCVM<<Federate;
+ * --- [label="waiting for reply"];
+ * ...;
+ * BCVM=>Federate [label="tickWrapper"];
+ * Federate=>RTI [label="evokeCallback"];
+ * Federate<-RTI [label="timeAdvanceGrant"];
+ * Federate>>RTI;
+ * Federate<<RTI;
+ * BCVM=>Federate [label="tickWrapper"];
+ * Federate=>RTI [label="evokeCallback"];
+ * Federate<-RTI [label="receiveInteraction"];
+ * Federate>>RTI;
+ * Federate<<RTI;
+ * BCVM=>Federate [label="sendTSOWrapper"];
+ * Federate=>RTI [label="sendInteraction"];
+ * Federate<<RTI;
+ * \endmsc
+ */
+void BCVM::loop() {
+#ifndef DISABLE_TIME_MANAGEMENT
+	for(;;) {
+		granted = received = false;
+		nextMessageWrapper( std::numeric_limits<double>::max() );
+		for( ; !(granted && received); tickWrapper( 1 ) );
+		bcvmMessageMap.at(bcvmXH) = any2var( terminalX );
+		bcvmMessageMap.at(bcvmIdH) = terminalId;
+		sendTSOWrapper( bcvmMessageH, bcvmMessageMap, logicalTime + lookahead, L"BCVM MESSAGE" );
+ 	}
+#else
+ 	for(;;) {
+		received = false;
+		for( ; !received; tickWrapper(1) );
+		bcvmMessageMap.at(bcvmXH) = any2var( terminalX );
+		bcvmMessageMap.at(bcvmIdH) = terminalId;
+		sendROWrapper( bcvmMessageH, bcvmMessageMap, L"BCVM MESSAGE" );
+ 	}
+#endif
+}
+
+//! Callback : receive interaction
+void BCVM::receiveInteraction(
+	rti1516::InteractionClassHandle _theInteraction,
+	rti1516::ParameterHandleValueMap const &_theParameterValues,
+	rti1516::VariableLengthData const &_theUserSuppliedTag,
+	rti1516::OrderType _sentOrder,
+	rti1516::TransportationType _theType
+) throw (
+		rti1516::InteractionClassNotRecognized,
+		rti1516::InteractionParameterNotRecognized,
+		rti1516::InteractionClassNotSubscribed,
+		rti1516::FederateInternalError
+	) {
+
+	// Control print
+	out << "message tagged as " << var2str<wchar_t>( _theUserSuppliedTag ) << " received." << std::endl;
+	out << "message sent order type is " << ((_sentOrder==rti1516::TIMESTAMP)?"TSO":"RO") << std::endl;
+
+	// Error handling
+	if ( _theInteraction != terminalMessageH )
+		throw rti1516::InteractionClassNotRecognized( L"unknown interaction received" );
+	rti1516::ParameterHandleValueMap::const_iterator end = _theParameterValues.end();
+	if ( _theParameterValues.find( terminalIdH ) == end || _theParameterValues.find( terminalXH ) == end )
+		throw rti1516::FederateInternalError( L"interaction does not have sufficient parameter set" );
+	out << "message body correct." << std::endl;
+	
+	// State changing
+	var2any( _theParameterValues.at(terminalXH), terminalX );
+	terminalId = _theParameterValues.at(terminalIdH);
+	out << "terminalId = " << var2any<long>(terminalId) << " X = " << terminalX << std::endl;
+	received = true;
+}
+
+void BCVM::receiveInteraction(
+	rti1516::InteractionClassHandle _theInteraction,
+	rti1516::ParameterHandleValueMap const &_theParameterValues,
+	rti1516::VariableLengthData const &_theUserSuppliedTag,
+	rti1516::OrderType _sentOrder,
+	rti1516::TransportationType _theType,
+	rti1516::LogicalTime const &_theTime,
+	rti1516::OrderType _receivedOrder,
+	rti1516::MessageRetractionHandle _theHandle
+)
+	throw (
+		rti1516::InteractionClassNotRecognized,
+		rti1516::InteractionParameterNotRecognized,
+		rti1516::InteractionClassNotSubscribed,
+		rti1516::InvalidLogicalTime,
+		rti1516::FederateInternalError
+	) {
+		
+	// Control print
+	out << "message tagged as " << var2str<wchar_t>( _theUserSuppliedTag ) << " received." << std::endl;
+	out << "message receive order type is " << ((_receivedOrder==rti1516::TIMESTAMP)?"TSO":"RO") << std::endl;
+	out << "message timestamp is " << ((RTI1516fedTime*)&_theTime)->getFedTime() << std::endl;
+
+	// Error handling
+	if ( _theInteraction != terminalMessageH )
+		throw rti1516::InteractionClassNotRecognized( L"unknown interaction received" );
+	rti1516::ParameterHandleValueMap::const_iterator end = _theParameterValues.end();
+	if ( _theParameterValues.find( terminalIdH ) == end || _theParameterValues.find( terminalXH ) == end )
+		throw rti1516::FederateInternalError( L"interaction does not have sufficient parameter set" );
+	out << "message body correct." << std::endl;
+	
+	// State changing
+	var2any( _theParameterValues.at(terminalXH), terminalX );
+	terminalId = _theParameterValues.at(terminalIdH);
+	out << "terminalId = " << var2any<long>(terminalId) << " X = " << terminalX << std::endl;
+	received = true;
+}
+
+// ----------------------------------------------------------------------------
+
+int main( int argc, char **argv ) {
+	BCVM bcvm(  L"BCVMTest", L"BCVMTest.fed"  );
+	bcvm.execute();
+}
\ No newline at end of file
diff -U 3 -H -d -r -N -x 'install/*' -x 'build/*' -- original/applications/HLA_TestsSuite/bcvm.h cvsrep/applications/HLA_TestsSuite/bcvm.h
--- original/applications/HLA_TestsSuite/bcvm.h	1970-01-01 03:00:00.000000000 +0300
+++ cvsrep/applications/HLA_TestsSuite/bcvm.h	2011-02-27 14:19:34.000000000 +0300
@@ -0,0 +1,81 @@
+/*! \file
+ * File includes definition of onboard central computer federate - so called BCVM.
+ * BCVM gets messages from set of terminals (another kind of federate) and
+ * sends received data back.
+ * 
+ * \author Eugene Chemeritskiy
+ * \date 25 FEB 2011
+ */
+
+#pragma once
+#ifndef BCVM_H
+#define BCVM_H
+
+#include "federate.h"
+
+/*! Onboard central computer federate.
+ */
+class BCVM : public Federate {
+private:
+	// definition of interaction and parameter handles and corresponding data
+	rti1516::ParameterHandleValueMap bcvmMessageMap;
+	rti1516::InteractionClassHandle bcvmMessageH;
+	rti1516::ParameterHandle bcvmIdH;
+	rti1516::ParameterHandle bcvmXH;
+	
+	rti1516::InteractionClassHandle terminalMessageH;
+	rti1516::ParameterHandle terminalIdH;
+	rti1516::ParameterHandle terminalXH;
+	
+	rti1516::VariableLengthData terminalId;
+	int terminalX;
+	
+	void getHandles();
+	void customInit();
+	void loop();
+
+public:
+	BCVM( std::wstring _federatoinName, std::wstring _fddName );
+	virtual ~BCVM() throw () {};
+	
+	//========================================================
+	// FEDERATE AMBASSADOR CALLBACKS
+	//========================================================
+
+	//--------------------------------------------------------
+	// Object management
+	
+	virtual void receiveInteraction( 
+		rti1516::InteractionClassHandle theInteraction,
+		rti1516::ParameterHandleValueMap const & theParameterValues,
+		rti1516::VariableLengthData const & theUserSuppliedTag,
+		rti1516::OrderType sentOrder,
+		rti1516::TransportationType theType
+	)
+		throw (
+			rti1516::InteractionClassNotRecognized,
+			rti1516::InteractionParameterNotRecognized,
+			rti1516::InteractionClassNotSubscribed,
+			rti1516::FederateInternalError
+		);
+		
+	virtual void receiveInteraction(
+		rti1516::InteractionClassHandle _theInteraction,
+		rti1516::ParameterHandleValueMap const &_theParameterValues,
+		rti1516::VariableLengthData const &_theUserSuppliedTag,
+		rti1516::OrderType _sentOrder,
+		rti1516::TransportationType vtheType,
+		rti1516::LogicalTime const &_theTime,
+		rti1516::OrderType _receivedOrder,
+		rti1516::MessageRetractionHandle _theHandle
+	)
+		throw (
+			rti1516::InteractionClassNotRecognized,
+			rti1516::InteractionParameterNotRecognized,
+			rti1516::InteractionClassNotSubscribed,
+			rti1516::InvalidLogicalTime,
+			rti1516::FederateInternalError
+		);
+};
+
+#endif // BCVM_H
diff -U 3 -H -d -r -N -x 'install/*' -x 'build/*' -- original/applications/HLA_TestsSuite/dtest_ping_pong.py cvsrep/applications/HLA_TestsSuite/dtest_ping_pong.py
--- original/applications/HLA_TestsSuite/dtest_ping_pong.py	1970-01-01 03:00:00.000000000 +0300
+++ cvsrep/applications/HLA_TestsSuite/dtest_ping_pong.py	2011-02-27 15:12:59.749984002 +0300
@@ -0,0 +1,206 @@
+#!/usr/bin/env python
+
+##-----------------------------------------------------------------------
+##
+## HLA Tests Suite
+##
+## Copyright (c) 2006-2008 Eric NOULARD, Jean-Yves ROUSSELOT 
+##
+## This library is free software; you can redistribute it and/or
+## modify it under the terms of the GNU Lesser General Public
+## License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+##
+## This library is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+## Lesser General Public License for more details.
+##
+## You should have received a copy of the GNU Lesser General Public
+## License along with this library; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+##
+##-----------------------------------------------------------------------
+
+import logging
+import os
+import time
+import threading
+import getopt, sys
+import dtest  
+
+##WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
+## getting options from cmd ---------------------------------------
+
+def usage():
+    print '''%s command line option list:
+[--help]
+[--certi_home=<path>]
+--rtig=[[<user>@]<host>]:<rtig_path>
+--fom=<fom_path>
+--bcvm=[[<user>@]<host>]:<federate_path>
+--terminal=[[<user>@]<host>]:<federate_path>''' % sys.argv[0]
+
+try:
+    opts, args = getopt.getopt( sys.argv[1:], "", ["help","certi_home=","rtig=","fom=","bcvm=","terminal="])
+except getopt.GetoptError, err:
+    print >> sys.stderr, "opt = %s, msg = %s" % (err.opt,err.msg)
+    usage()
+    sys.exit(2)
+
+## setting default values
+
+certi_home_defined=False
+rtig_param = dtest.Utils.getUserHostPath("rtig")
+bcvm_param = dtest.Utils.getUserHostPath("bcvm")
+terminal_param = dtest.Utils.getUserHostPath("terminal")
+FOMFile="ping_pong.fed"
+
+## getting merged values
+
+for o, a in opts:
+    if o in ("--help"):
+            usage()
+            sys.exit(2)
+    if o in ("--rtig"):
+        rtig_param   = dtest.Utils.getUserHostPath(a)
+    if o in ("--bcvm"):
+        bcvm_param = dtest.Utils.getUserHostPath(a)
+    if o in ("--terminal"):
+        terminal_param = dtest.Utils.getUserHostPath(a)
+    if o in ("--certi_home"):
+        certi_home = a
+        certi_home_defined=True
+    if o in ("--fom"):
+        FOMFile = a
+        
+if not certi_home_defined:
+    if os.environ.has_key("CERTI_HOME"):
+        certi_home=os.environ["CERTI_HOME"]
+    else: 
+        print "You must define CERTI_HOME environment variable or set corresponding command line option"
+        sys.exit(2)
+
+##WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
+## dtest object definition ----------------------------------------
+
+rtig = dtest.DTester(
+    "RTIG",
+    session=dtest.SSHSessionHandler(
+        rtig_param['user'],
+        host=rtig_param['host']
+    )
+)
+
+bcvm = dtest.DTester(
+    "bcvm",
+    session=dtest.SSHSessionHandler(
+        bcvm_param['user'],
+        host=bcvm_param['host']
+    )
+)
+
+terminal = dtest.DTester(
+    "terminal",
+    session=dtest.SSHSessionHandler(
+        terminal_param['user'],
+        host=terminal_param['host']
+    )
+)
+
+##WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
+## rtig -----------------------------------------------------------
+
+# you may change the default time out value or save the output to a file.
+rtig.timeout = 40
+rtig.stdout    = file(rtig.name + ".out",'w+')
+rtig.stdin     = file(rtig.name + ".in",'w+')
+rtig.stderr    = file(rtig.name + ".err",'w+')
+
+# describe RTIG run steps
+rtig.addRunStep("ok",True,"HLA test create_destroy Starts.")
+dtest.ReusableSequences.addConditionalRunShellScript(
+    rtig,
+    c_shell_cmd="source "+certi_home+"/share/scripts/myCERTI_env.csh "+rtig_param['host'],
+    bourne_shell_cmd="source "+certi_home+"/share/scripts/myCERTI_env.sh "+rtig_param['host']
+)
+
+rtig.addRunStep("runCommand",command=rtig_param['path'])
+rtig.addRunStep("expectFromCommand",pattern="CERTI RTIG up and running",timeout=5)
+rtig.addRunStep("barrier","RTIG started")
+rtig.addRunStep("barrier","All Federate(s) ended")
+rtig.addRunStep("terminateCommand")
+rtig.addRunStep("waitCommandTermination")
+rtig.addRunStep("ok",True,"HLA test create_destroy Ends.")
+
+##WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
+## bcvm -----------------------------------------------------------
+
+# you may change the default time out value or save the output to a file.
+bcvm.timeout = 20
+bcvm.stdout  = file(bcvm.name + ".out",'w+')
+bcvm.stdin   = file(bcvm.name + ".in",'w+')
+bcvm.stderr  = file(bcvm.name + ".err",'w+')
+
+bcvm.addRunStep("barrier","RTIG started")
+dtest.ReusableSequences.addConditionalRunShellScript(
+    bcvm,
+    c_shell_cmd="source "+certi_home+"/share/scripts/myCERTI_env.csh "+rtig_param['host'],
+    bourne_shell_cmd="source "+certi_home+"/share/scripts/myCERTI_env.sh "+rtig_param['host']
+)
+
+bcvm.addRunStep("runCommand",command=bcvm_param['path']+" "+bcvm.name)
+bcvm.addRunStep("barrier","RTIG started")
+bcvm.addRunStep("expectFromCommand",pattern="joining to federation...")
+bcvm.addRunStep("ok",bcvm.getFutureLastStepStatus,"Federate Joined")
+bcvm.addRunStep("expectFromCommand",pattern="federation synchronised with label Init...")
+bcvm.addRunStep("ok",bcvm.getFutureLastStepStatus,"Federation Synchronised")
+bcvm.addRunStep("expectFromCommand",pattern="BCVM : logical time advanced to 190")
+bcvm.addRunStep("ok",bcvm.getFutureLastStepStatus,"Federate finished")
+bcvm.addRunStep("barrier","All Federate(s) ended")
+bcvm.addRunStep("terminateCommand")
+bcvm.addRunStep("waitCommandTermination")
+
+##WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
+## terminal -------------------------------------------------------
+
+# you may change the default time out value or save the output to a file.
+terminal.timeout = 20
+terminal.stdout  = file(terminal.name + ".out",'w+')
+terminal.stdin   = file(terminal.name + ".in",'w+')
+terminal.stderr  = file(terminal.name + ".err",'w+')
+
+terminal.addRunStep("barrier","RTIG started")
+dtest.ReusableSequences.addConditionalRunShellScript(
+    terminal,
+    c_shell_cmd="source "+certi_home+"/share/scripts/myCERTI_env.csh "+rtig_param['host'],
+    bourne_shell_cmd="source "+certi_home+"/share/scripts/myCERTI_env.sh "+rtig_param['host']
+)
+
+terminal.addRunStep("runCommand",command=terminal_param['path']+" "+bcvm.name)
+terminal.addRunStep("barrier","RTIG started")
+terminal.addRunStep("expectFromCommand",pattern="joining to federation...")
+terminal.addRunStep("ok",terminal.getFutureLastStepStatus,"Federate Joined")
+terminal.addRunStep("expectFromCommand",pattern="federation synchronised with label Init...")
+terminal.addRunStep("ok",terminal.getFutureLastStepStatus,"Federation Synchronised")
+terminal.addRunStep("expectFromCommand",pattern="Terminal : logical time advanced to 200")
+terminal.addRunStep("ok",terminal.getFutureLastStepStatus,"Federate finished")
+terminal.addRunStep("barrier","All Federate(s) ended")
+terminal.addRunStep("waitCommandTermination")
+
+##WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
+## test launch ----------------------------------------------------
+
+def goTest():
+    myDTestMaster = dtest.DTestMaster(
+        "HLA test ping_pong Starts",
+        "Launch RTIG + bcvm + one terminal federates to get benchmark result..."
+    )
+    myDTestMaster.timeout = 40
+    myDTestMaster.register(rtig)
+    myDTestMaster.register(bcvm) 
+    myDTestMaster.register(terminal) 
+    myDTestMaster.startTestSequence()
+    myDTestMaster.waitTestSequenceEnd()
+    
+goTest()
diff -U 3 -H -d -r -N -x 'install/*' -x 'build/*' -- original/applications/HLA_TestsSuite/federate.cpp cvsrep/applications/HLA_TestsSuite/federate.cpp
--- original/applications/HLA_TestsSuite/federate.cpp	1970-01-01 03:00:00.000000000 +0300
+++ cvsrep/applications/HLA_TestsSuite/federate.cpp	2011-02-25 17:39:51.000000000 +0300
@@ -0,0 +1,366 @@
+#include <signal.h> // signal set_terminate set_unexpected SIGINT
+#include <stdlib.h> // exit EXIT_FAILURE
+#include <iterator> // ostream_iterator
+#include <string>
+
+#include "federate.h"
+
+std::ostream& operator << ( std::ostream& _stream, std::wstring _wstr ) {
+	typedef std::ostream_iterator<char,char,std::char_traits<char> > inserter;
+	std::copy( _wstr.begin(), _wstr.end(), inserter(_stream,"") );
+	return _stream;
+}
+
+//WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
+// Federate concerned definitions----------------------------------------------
+
+Federate::Federate( std::wstring _federateName, std::wstring _federationName,
+		std::wstring _fddName, std::ostream& _out, std::ostream& _err ) :
+		logicalTime(0), lookahead(0), out( _out ), err( _err ) {
+	federationName = _federationName;
+	federateName = _federateName;
+	fddName = _fddName;
+	out.init( _federateName );
+	err.init( _federateName );
+}
+
+Federate::~Federate() throw() {
+	resignWrapper();
+}
+
+//WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
+// RTI AMBASSADOR WRAPPERS-----------------------------------------------------
+
+bool Federate::tickWrapper( double _seconds ) {
+	out << "calling evokeCallback..." << std::endl;
+	return rtiamb->evokeCallback( _seconds );
+}
+
+void Federate::initWrapper() {
+	rti1516::RTIambassadorFactory factory;
+	std::vector<std::wstring> paramSet;
+	//! TODO: figure out if additional parameter works.
+	paramSet.push_back( L"-v 2" );
+	rtiamb = factory.createRTIambassador( paramSet );
+	joinWrapper();
+	getHandlesWrapper();
+	customInit();
+}
+
+void Federate::joinWrapper() {
+	out << "trying to create federation from FDD file " << fddName << "..." << std::endl;
+	try {
+		rtiamb->createFederationExecution( federationName, fddName );
+		out << "succeeded." << std::endl;
+	}
+	catch ( rti1516::FederationExecutionAlreadyExists &e ) {
+		out << "federation execution already exists - trying to join it..." << std::endl;
+	}
+	catch ( rti1516::CouldNotOpenFDD &e ) {
+		err << "FED file could not be opened." << std::endl;
+		throw;
+	}
+
+	out << "joining to federation..." << std::endl;
+	try {
+		federateHandle = rtiamb->joinFederationExecution( federateName, federationName, (*this) );
+		out << "succeeded." << std::endl;
+	}
+	catch (rti1516::FederateAlreadyExecutionMember ) {
+		err << "Federate " << federateName << "already exists." << std::endl ;
+		throw;
+	}
+}
+
+void Federate::synchronisationWrapper( std::wstring _label, std::wstring _tag, int _autostart ) {
+	synchronised = false;
+	out << "trying to register synchronisation point " << _label << "..." << std::endl;
+	try {
+		rtiamb->registerFederationSynchronizationPoint( _label, str2var(_tag) );
+		out << "succeeded." << std::endl;
+	} catch ( rti1516::RTIinternalError &e ) {
+		out << "synchronisation point may be in use - trying to resume..." << std::endl;
+	}
+
+	if ( _autostart != 0 ) {
+		out << "auto start is set to " << _autostart << std::endl;
+		if ( _autostart > 0 ) {
+			out << "[you should set auto start to zero to start execution manually]" << std::endl;
+			do {
+				// printing directly to cout
+				std::cout << "\rautostart in " << _autostart << " second(s)";
+				std::cout.flush();
+				sleep( 1 );
+			} while ( --_autostart > 0 );
+			std::cout << "starting execution automatically..." << std::endl;
+		} else {
+			out << "[you should set auto start to positive value to start execution automatically]" << std::endl;
+			std::cout << "press any key to start execution" << std::endl;
+			std::cout.flush();
+			std::cin.get();
+		}
+	}
+	
+	out << "informing RTI of achieving synchronisation point..." << std::endl;
+	rtiamb->synchronizationPointAchieved( _label );
+	out << "succeeded." << std::endl;
+
+	// Waiting for federation synchronisation
+	do tickWrapper( 1 );
+	while ( !synchronised );
+}
+
+void Federate::getHandlesWrapper() {
+    out << "getting handles..." << std::endl;
+	try {
+		getHandles();
+		out << "succeeded." << std::endl;
+	}
+	catch ( rti1516::NameNotFound ) {
+		err << "requested object name not found in FDD file." << std::endl;
+	}
+	catch ( rti1516::FederateNotExecutionMember ) {
+		err << "cannot get handle in unjoined state." << std::endl;
+	}
+}
+
+void Federate::publishWrapper( rti1516::InteractionClassHandle _handle ) {
+	out << "trying to publish interaction class...";
+	rtiamb->publishInteractionClass( _handle );
+	out << "succeeded." << std::endl;
+}
+
+void Federate::subscribeWrapper( rti1516::InteractionClassHandle _handle, bool _active ) {
+	out << "trying to subscribe interaction class...";
+	rtiamb->subscribeInteractionClass( _handle, _active );
+	out << "succeeded." << std::endl;
+}
+
+void Federate::sendROWrapper( rti1516::InteractionClassHandle _handle,
+		rti1516::ParameterHandleValueMap _map, std::wstring _tag ) {
+	out << "trying to send RO interaction...";
+	try {
+		rtiamb->sendInteraction( _handle, _map, str2var(_tag) );
+		out << "succeeded." << std::endl;
+	}
+	catch ( rti1516::InteractionClassNotPublished ) {
+		err << "interaction class not published." << std::endl;
+		throw;
+	}
+}
+
+void Federate::sendTSOWrapper( rti1516::InteractionClassHandle _handle,
+		rti1516::ParameterHandleValueMap _map, double _timestamp, std::wstring _tag ) {
+	out << "trying to send TSO interaction..." << std::endl;
+	try {
+		rtiamb->sendInteraction( _handle, _map, str2var(_tag), RTI1516fedTime(_timestamp) );
+		out << "succeeded." << std::endl;
+	}
+	catch ( rti1516::InteractionClassNotPublished ) {
+		err << "interaction class not published." << std::endl;
+		throw;
+	}
+}
+
+void Federate::resignWrapper() {
+	out << "trying to resign from federation " << federationName << "..." << std::endl;
+	rtiamb->resignFederationExecution( rti1516::DELETE_OBJECTS );
+	out << "succeeded." << std::endl;
+
+	out << "trying to destroy federation " << federationName << "..." << std::endl;
+	try {
+		rtiamb->destroyFederationExecution( federationName );
+		out << "succeeded." << std::endl;
+	}
+	catch ( rti1516::FederatesCurrentlyJoined ) {
+		out << "permission denied - more joined federates exist." << std::endl;
+	}
+}
+
+void Federate::enableConstrainedModeWrapper() {
+	enabled = false;
+	out << "trying to enable time constrained mode..." << std::endl;
+ 	rtiamb->enableTimeConstrained();
+	out << "succeeded" << std::endl;
+	for( ; !enabled; tickWrapper(0) );
+}
+
+void Federate::enableRegulationModeWrapper() {
+	enabled = false;
+	out << "trying to enable time regulation mode..." << std::endl;
+	rtiamb->enableTimeRegulation( RTI1516fedTimeInterval( lookahead ) );
+	out << "succeeded" << std::endl;
+	for( ; !enabled; tickWrapper(0) );
+}
+
+void Federate::timeAdvanceWrapper( double _newTime ) {
+	out << "making time advance request..." << std::endl;
+	rtiamb->timeAdvanceRequest( RTI1516fedTime(_newTime) );
+	out << "succeeded." << std::endl;
+}
+
+void Federate::nextMessageWrapper( double _newTime ) {
+	out << "trying to advance to next message time..." << std::endl;
+	rtiamb->nextMessageRequest( RTI1516fedTime(_newTime) );
+	out << "succeeded." << std::endl;
+}
+
+void Federate::execute() {
+	try {
+		initWrapper();
+		synchronisationWrapper( L"Init", L"Initial synchronisation point", 5 );
+		out << "Starting execute custom code..." << std::endl;
+		loop();
+		out << "Custom code finished." << std::endl;
+	}
+	catch ( rti1516::Exception &e ) {
+		err << "Unexpected RTI exception caught while execution " << e.what() << "." << std::endl;
+		exit( EXIT_FAILURE );
+	}
+	catch (...) {
+		err << "Unknown non-RTI exception caught while execution." << std::endl;
+		exit( EXIT_FAILURE );
+	}
+}
+
+//WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
+// Federate ambassador callbacks-----------------------------------------------
+
+//--------------------------------------------------------
+// Federation management----------------------------------
+
+void Federate::synchronizationPointRegistrationSucceeded( std::wstring const &_label )
+		throw (rti1516::FederateInternalError) {
+	out << "registration of synchronisation point " << _label << " accepted." << std::endl;
+}
+
+void Federate::synchronizationPointRegistrationFailed( std::wstring const &_label,
+	rti1516::SynchronizationFailureReason _reason
+		) throw (rti1516::FederateInternalError) {
+	/*! BUG: message is always the same and does not correspond to caused problem
+	 * reason is always equal to RTI_DETECTED_FAILURE_DURING_SYNCHRONIZATION
+	 */
+// 	if ( _reason == rti1516::SYNCHRONIZATION_POINT_LABEL_NOT_UNIQUE )
+		out << "Synchronisation point have been already registered, trying to skip..." << std::endl;
+// 	else {
+// 		err << "Registration of " << _label << " failed (the reason is " << _reason << ")" << std::endl;
+// 		throw rti1516::FederateInternalError( L"Synchronisation point rejected." );
+// 	}
+}
+
+void Federate::announceSynchronizationPoint( std::wstring  const &_label,
+	rti1516::VariableLengthData const &_tag
+		) throw (rti1516::FederateInternalError) {
+	if ( _label == L"Init" ) {
+		out << "Synchronisation point " << _label << " announced." << std::endl;
+	} else {
+		err << "Unknown synchronisation point " << _label << std::endl;
+		throw rti1516::FederateInternalError( L"Unknown synchronisation point." );
+	}
+}
+
+void Federate::federationSynchronized( std::wstring const &_label )
+		throw (rti1516::FederateInternalError) {
+ 	if ( _label == L"Init" ) {
+		out << "federation synchronised with label " << _label << std::endl;
+		synchronised = true;
+	} else {
+		err << "Unknown synchronisation point " << _label << std::endl;
+		throw rti1516::FederateInternalError( L"Unknown synchronisation point." );
+	}
+}
+
+//--------------------------------------------------------
+// Declaration management---------------------------------
+
+void Federate::turnInteractionsOn(rti1516::InteractionClassHandle _theHandle)
+		throw ( rti1516::InteractionClassNotPublished, rti1516::FederateInternalError ) {
+	//! TODO: figure out if this works.
+	out << "interactions turns on." << std::endl;
+}
+
+void Federate::turnInteractionsOff(rti1516::InteractionClassHandle _theHandle)
+		throw ( rti1516::InteractionClassNotPublished, rti1516::FederateInternalError ) {
+	//! TODO: figure out if this works.
+	out << "interactions turns off." << std::endl;
+}
+
+//--------------------------------------------------------
+// Object management--------------------------------------
+
+void Federate::receiveInteraction(
+	rti1516::InteractionClassHandle _theInteraction,
+	rti1516::ParameterHandleValueMap const &_theParameterValues,
+	rti1516::VariableLengthData const &_theUserSuppliedTag,
+	rti1516::OrderType _sentOrder,
+	rti1516::TransportationType _theType
+) throw (
+		rti1516::InteractionClassNotRecognized,
+		rti1516::InteractionParameterNotRecognized,
+		rti1516::InteractionClassNotSubscribed,
+		rti1516::FederateInternalError
+	) {
+	out << "[you should redeclare method to make a custom receive]" << std::endl;
+	out << "message tagged as " << var2str<wchar_t>( _theUserSuppliedTag ) << " received." << std::endl;
+	out << "message sent order type is " << ((_sentOrder==rti1516::TIMESTAMP)?"TSO":"RO") << std::endl;
+}
+
+void Federate::receiveInteraction(
+	rti1516::InteractionClassHandle _theInteraction,
+	rti1516::ParameterHandleValueMap const &_theParameterValues,
+	rti1516::VariableLengthData const &_theUserSuppliedTag,
+	rti1516::OrderType _sentOrder,
+	rti1516::TransportationType _theType,
+	rti1516::LogicalTime const &_theTime,
+	rti1516::OrderType _receivedOrder,
+	rti1516::MessageRetractionHandle _theHandle
+)
+	throw (
+		rti1516::InteractionClassNotRecognized,
+		rti1516::InteractionParameterNotRecognized,
+		rti1516::InteractionClassNotSubscribed,
+		rti1516::InvalidLogicalTime,
+		rti1516::FederateInternalError
+	) {
+	//! BUG: message receive order type is always RO
+	out << "[you should redeclare method to make a custom receive]" << std::endl;
+	out << "message tagged as " << var2str<wchar_t>( _theUserSuppliedTag ) << " received." << std::endl;
+	out << "message receive order type is " << ((_receivedOrder==rti1516::TIMESTAMP)?"TSO":"RO") << std::endl;
+	out << "message timestamp is " << ((RTI1516fedTime*)&_theTime)->getFedTime() << std::endl;
+}
+
+//--------------------------------------------------------
+// Time management----------------------------------------
+
+void Federate::timeRegulationEnabled( rti1516::LogicalTime const &_theFederateTime )
+	throw (
+		rti1516::InvalidLogicalTime,
+		rti1516::NoRequestToEnableTimeRegulationWasPending,
+		rti1516::FederateInternalError
+	) {
+	logicalTime = ((RTI1516fedTime*)&_theFederateTime)->getFedTime();
+	out << "time regulation mode enabled with logical time equals to " << logicalTime << std::endl;
+	enabled = true;
+}
+
+void Federate::timeConstrainedEnabled( rti1516::LogicalTime const &_theFederateTime )
+	throw (
+		rti1516::InvalidLogicalTime,
+		rti1516::NoRequestToEnableTimeConstrainedWasPending,
+		rti1516::FederateInternalError
+	) {
+	logicalTime = ((RTI1516fedTime*)&_theFederateTime)->getFedTime();
+	out << "time constrained mode enabled with logical time equals to " << logicalTime << std::endl;
+	enabled = true;
+}
+
+void Federate::timeAdvanceGrant( rti1516::LogicalTime const &_theTime )
+		throw (
+			rti1516::InvalidLogicalTime,
+			rti1516::JoinedFederateIsNotInTimeAdvancingState,
+			rti1516::FederateInternalError
+		) {
+	logicalTime = ((RTI1516fedTime*)&_theTime)->getFedTime();
+	out << "logical time advanced to " << logicalTime << std::endl;
+	granted = true;
+}
\ No newline at end of file
diff -U 3 -H -d -r -N -x 'install/*' -x 'build/*' -- original/applications/HLA_TestsSuite/federate.h cvsrep/applications/HLA_TestsSuite/federate.h
--- original/applications/HLA_TestsSuite/federate.h	1970-01-01 03:00:00.000000000 +0300
+++ cvsrep/applications/HLA_TestsSuite/federate.h	2011-02-27 14:28:39.000000000 +0300
@@ -0,0 +1,411 @@
+/*! \file
+ * File contains the set of RTI service wrappers convenient for BCVMTest federation.
+ * 
+ * The main purpose of this wrapper set is to hide disadvantages of generalised
+ * type using and to provide ability to apply standard C++ types.
+ * Library consists of a number of template functions devoted to data conversion
+ * and Federate class that should be inherited by user custom federates.
+ * 
+ * \author Eugene Chemeritskiy
+ * \date 25 FEB 2011
+ */
+
+#pragma once
+#ifndef FEDERATE_H
+#define FEDERATE_H
+
+#include <iostream>
+
+#include <RTI/RTI1516.h>
+#include <RTI/RTI1516fedTime.h>
+#include <RTI/NullFederateAmbassador.h>
+
+//! TODO: figure out how to use libhla macros without this definition
+//! Macros using whereas converting from one endian to another
+#define LIBHLA_INT64_CONSTANT( val ) val##L
+#include <libhla.hh>
+
+#ifdef _WIN32
+#include <windows.h>
+#define sleep(a) Sleep(a * 1000)
+#define usleep(a) Sleep(a / 1000)
+#endif
+
+//WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
+// Logging function set------------------------------------------------
+
+//! Allows to send std::wsting object to standard ostream.
+std::ostream& operator << ( std::ostream& _stream, std::wstring _wstr );
+
+//! Class to manage program output.
+/*! Class represents a wrapper of std::ostream.
+ * Its distinction is that it repeats the provided prompt
+ * at the beginning of each printed line.
+ */
+class Dumper {
+private:
+	std::ostream &ost;
+	std::wstring prompt;
+public:
+	Dumper( std::ostream &_ostream ) : ost(_ostream) {}
+	void init( std::wstring _prompt ) {prompt = _prompt;}
+	template< typename Type >
+	std::ostream& operator << ( Type _value ) {
+		return ost << prompt << " : " << _value;
+	}
+};
+
+//! Class to suppress output.
+/*! This class could be used if the user wants to
+ * omit output of Federate class.
+ */
+struct nullstream: public std::ostream {
+	struct nullbuf: std::streambuf {
+		int overflow(int c) { return traits_type::not_eof(c); }
+		
+	} m_sbuf;
+	nullstream(): std::ios(&m_sbuf), std::ostream(&m_sbuf) {}
+};
+
+//WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
+// Conversion function set---------------------------------------------
+
+//! Converts given variable to rti1516::VariableLengthData format
+/*! Size of \tparam type should not exceed sizeof( long ).
+ * This restriction concerned with endian conversion problem.
+ */
+template< typename Type >
+inline rti1516::VariableLengthData any2var( const Type &value ) {
+	if (sizeof(Type) > sizeof(unsigned long)) throw "Unsupported conversion";
+	unsigned long converted = LIBHLA_UINT64_TO_BE( *(unsigned long*)&value );
+	return rti1516::VariableLengthData( &converted, sizeof(converted) );
+}
+
+//! Converts given string variable to rti1516::VariableLengthData format
+/*! \tparam char_type Type used during std::string creation.
+ */
+template< typename char_type >
+inline rti1516::VariableLengthData str2var( const std::basic_string<char_type> &value ) {
+	return rti1516::VariableLengthData( value.c_str(), value.size() * sizeof(char_type) );
+}
+
+//! Converts given rti1516::VariableLengthData to required variable format
+/*! \copydetails any2var */
+template< typename Type >
+inline Type var2any( const rti1516::VariableLengthData &data ) {
+	if (data.size() > sizeof(unsigned long)) throw "Unsupported conversion";
+	unsigned long converted = LIBHLA_UINT64_FROM_BE( *(unsigned long*)data.data() );
+	return (Type)converted;
+}
+
+//! Converts given rti1516::VariableLengthData to required string format
+/*! \copydetails str2var */
+template< typename char_type >
+inline std::basic_string<char_type> var2str( const rti1516::VariableLengthData &data ) {
+	return std::basic_string<char_type>( (char_type*)data.data(), data.size() / sizeof(char_type) );
+}
+
+/*! The converted \param data value is assigned to \param any
+ */
+template< typename Type >
+inline Type var2any( const rti1516::VariableLengthData &data, Type& any ) {
+	return any = var2any<Type>( data );
+}
+
+/*! The converted \param data value is assigned to \param str
+ */
+template< typename char_type >
+inline std::basic_string<char_type> var2str( const rti1516::VariableLengthData &data, std::basic_string<char_type>& str ) {
+	return str = var2str<char_type>( data );
+}
+
+//WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
+// Federate class------------------------------------------------------
+
+//! Basic federate class to be inherited by custom user federates.
+/*! Provides wrappers of RTI ambassador method subset.
+ * Also it contains some variables most likely needed by its heirs
+ * and defines some abstract method that should be overloaded.
+ * 
+ * \msc
+ * Inheritor,Federate,RTI;
+ * Inheritor=>Federate [label="execute"];
+ * --- [label="joining to federation execution"];
+ * Federate=>RTI [label="createFederationExecution"];
+ * Federate<<RTI;
+ * Federate=>RTI [label="joinFederationExecution"];
+ * Federate<<RTI;
+ * --- [label="initialising joined federate"];
+ * Inheritor<-Federate [label="getHandles"];
+ * Inheritor>>Federate;
+ * Inheritor<-Federate [label="customInit"];
+ * Inheritor>>Federate;
+ * Federate=>RTI [label="registerFederationSynchronizationPoint"];
+ * --- [label="waiting for other simulation participants (terminals) registration"];
+ * ...;
+ * Federate=>RTI [label="achieveSynchronisationPoint"];
+ * Federate<<RTI;
+ * Federate=>RTI [label=evokeCallback];
+ * Federate<-RTI [label="synchronizationPointRegistrationSucceeded"];
+ * Federate>>RTI;
+ * Federate<<RTI;
+ * Federate=>RTI [label=evokeCallback];
+ * Federate<-RTI [label="announceSynchronizationPoint"];
+ * Federate>>RTI;
+ * Federate<<RTI;
+ * Federate=>RTI [label=evokeCallback];
+ * Federate<-RTI [label="federationSynchronized"];
+ * Federate>>RTI;
+ * Federate<<RTI;
+ * Federate=>RTI [label=evokeCallback];
+ * Federate<-RTI [label="federationSynchronized"];
+ * Federate>>RTI;
+ * Federate<<RTI;
+ * ...;
+ * --- [label="waiting for full federation synchronisation"];
+ * Federate=>RTI [label=evokeCallback];
+ * Federate<<RTI;
+ * ...;
+ * --- [label="starting federate main simulation loop"];
+ * Inheritor<-Federate [label="loop"];
+ * ...;
+ * Inheritor>>Federate;
+ * --- [label="resigning from federation execution"];
+ * Federate=>RTI [label="resignFederationExecution"];
+ * Federate<<RTI;
+ * Federate=>RTI [label="destroyFederationExecution"];
+ * Federate<<RTI;
+ * Inheritor<<Federate;
+ * \endmsc
+ */
+class Federate : public rti1516::NullFederateAmbassador {
+
+	//! Method invokes used defined getHandles method and handles errors.
+	void getHandlesWrapper();
+
+	//! Initialises federate as a part of federation.
+	void initWrapper();
+
+protected:
+	//====================================================================
+	// Additional attributes----------------------------------------------
+	
+	bool synchronised; //!< is set if synchronisation point registration succeeded.
+	bool received; //!< is set if interaction received.
+	bool granted; //!< is set if time advanced.
+	bool enabled; //!< is set if time management mode enabled.
+	
+	std::auto_ptr<rti1516::RTIambassador> rtiamb;
+	rti1516::FederateHandle federateHandle;
+	std::wstring federationName;
+	std::wstring federateName;
+	std::wstring fddName; //!< FDD file id
+
+	double lookahead;
+	double logicalTime;
+
+	Dumper out; //!< stream wrapper instance used for log output
+	Dumper err; //!< stream wrapper instance used for error output
+	
+	//! Wraps evokeCallback method
+	bool tickWrapper( double _seconds = 1 );
+	
+	//====================================================================
+	// Federation management----------------------------------------------
+	
+	//! Joins to specified federation
+	/*! Tries to join federation having specified by federationName attribute.
+	 * If there is no such federation a new one is created using FDDName attribute.
+	 */
+	void joinWrapper();
+	
+	//! Makes initial federate synchronisation.
+	/*! \pre federate should be joined to the federation execution.
+	 * If \param _autostart is set to non-positive value federation
+	 * achieves the point after the user will hit a key.
+	 * In case of zero value the synchronisation point is achieved immediately.
+	 * If \param _autostart is set to non-positive value federation
+	 * achieves the point automatically after _autostart seconds.
+	 * \param _label Synchronization point id
+	 * \param _tag User supplied tag
+	 */
+	void synchronisationWrapper( std::wstring _label, std::wstring _tag, int _autostart = 0 );
+	
+	//! Resigns from federation execution and tries to destroy it.
+	void resignWrapper();
+	
+	//====================================================================
+	// Declaration management---------------------------------------------
+	
+	//! Publishes given interaction.
+	void publishWrapper( rti1516::InteractionClassHandle _handle );
+	
+	//! Subscribes given interaction.
+	void subscribeWrapper( rti1516::InteractionClassHandle _handle, bool active = true );
+	
+	//====================================================================
+	// Object management--------------------------------------------------
+	
+	//! Sends RO message
+	void sendROWrapper(
+		rti1516::InteractionClassHandle _handle,
+		rti1516::ParameterHandleValueMap _map,
+		std::wstring _tag = L""
+	);
+	
+	//! Sends TSO message.
+	void sendTSOWrapper(
+		rti1516::InteractionClassHandle _handle,
+		rti1516::ParameterHandleValueMap _map,
+		double _timestamp,
+		std::wstring _tag = L""
+	);
+	
+	//====================================================================
+	// Time management----------------------------------------------------
+	
+	//! Enables time constrained mode
+	void enableConstrainedModeWrapper();
+	//! Enables time regulation mode with lookahead attribute.
+	void enableRegulationModeWrapper();
+	//! Wraps time advance request service.
+	void timeAdvanceWrapper( double _newTime );
+	//! Wraps next message request service.
+	void nextMessageWrapper( double _newTime );
+
+public:
+	//! Set default log stream to std::cout and default error stream to std::cerr.
+	Federate( std::wstring _federateName, std::wstring _federationName, std::wstring _fddName,
+		std::ostream& _out = std::cout, std::ostream& _err = std::cerr );
+	virtual ~Federate() throw ();
+
+	//====================================================================
+	// Abstract class methods---------------------------------------------
+
+	/*! It is assumed that the user will get handles to needed
+	 * federation-wild communication objects (such as interaction and its parameters)
+	 * inside of overloaded method. This assumption allows to
+	 * handle possible errors once inside of corresponding Federate class method.
+	 */
+	virtual void getHandles() = 0;
+
+	/*! This method should contain federate initialisation dependent on federation execution.
+	 * It is invoked automatically before federation synchronisation and
+	 * the beginning of main simulation loop.
+	 */
+	virtual void customInit() = 0;
+	
+	//! Main simulation loop.
+	virtual void loop() = 0;
+
+	//! Starts federation execution.
+	void execute();
+
+	//========================================================
+	// Overloaded federate ambassador callbacks---------------
+
+	//--------------------------------------------------------
+	// Federation management----------------------------------
+	
+	virtual void synchronizationPointRegistrationSucceeded( std::wstring const &_label )
+		throw (rti1516::FederateInternalError);
+
+    virtual void synchronizationPointRegistrationFailed(
+		std::wstring const &_label,
+		rti1516::SynchronizationFailureReason _reason
+	) throw (rti1516::FederateInternalError);
+
+	/*! Throws error if synchronisation point name is not equal to Init.
+	 */
+	virtual void announceSynchronizationPoint(
+		std::wstring  const &_label,
+		rti1516::VariableLengthData const &_theUserSuppliedTag
+	) throw (rti1516::FederateInternalError);
+
+	//! sets synchronised flag
+	/*! Throws error if synchronisation point name is not equal to Init.
+	 */
+	virtual void federationSynchronized( std::wstring const &_label )
+		throw (rti1516::FederateInternalError);
+	
+	//--------------------------------------------------------
+	// Declaration management---------------------------------
+		
+	virtual void turnInteractionsOn( rti1516::InteractionClassHandle _theHandle )
+		throw (
+			rti1516::InteractionClassNotPublished,
+			rti1516::FederateInternalError
+		);
+
+	virtual void turnInteractionsOff( rti1516::InteractionClassHandle _theHandle )
+		throw (
+			rti1516::InteractionClassNotPublished,
+			rti1516::FederateInternalError
+		);
+
+	//--------------------------------------------------------
+	// Object management--------------------------------------
+	
+	//! Prints reminder that the method should be overloaded.
+	virtual void receiveInteraction( 
+		rti1516::InteractionClassHandle _theInteraction,
+		rti1516::ParameterHandleValueMap const &_theParameterValues,
+		rti1516::VariableLengthData const &_theUserSuppliedTag,
+		rti1516::OrderType _sentOrder,
+		rti1516::TransportationType _theType
+	)
+		throw (
+			rti1516::InteractionClassNotRecognized,
+			rti1516::InteractionParameterNotRecognized,
+			rti1516::InteractionClassNotSubscribed,
+			rti1516::FederateInternalError
+		);
+	
+	//! Prints reminder that the method should be overloaded.
+	virtual void receiveInteraction(
+		rti1516::InteractionClassHandle _theInteraction,
+		rti1516::ParameterHandleValueMap const &_theParameterValues,
+		rti1516::VariableLengthData const &_theUserSuppliedTag,
+		rti1516::OrderType _sentOrder,
+		rti1516::TransportationType _theType,
+		rti1516::LogicalTime const &_theTime,
+		rti1516::OrderType _receivedOrder,
+		rti1516::MessageRetractionHandle _theHandle
+	)
+		throw (
+			rti1516::InteractionClassNotRecognized,
+			rti1516::InteractionParameterNotRecognized,
+			rti1516::InteractionClassNotSubscribed,
+			rti1516::InvalidLogicalTime,
+			rti1516::FederateInternalError
+		);
+		
+	//--------------------------------------------------------
+	// Time management----------------------------------------
+
+	//! Sets logicalTime to the given value.
+	virtual void timeRegulationEnabled( rti1516::LogicalTime const &_theFederateTime )
+		throw (
+			rti1516::InvalidLogicalTime,
+			rti1516::NoRequestToEnableTimeRegulationWasPending,
+			rti1516::FederateInternalError
+		);
+
+	//! Sets logicalTime to the given value.
+	virtual void timeConstrainedEnabled( rti1516::LogicalTime const &_theFederateTime )
+		throw (
+			rti1516::InvalidLogicalTime,
+			rti1516::NoRequestToEnableTimeConstrainedWasPending,
+			rti1516::FederateInternalError
+		);
+
+	//! Sets logicalTime to the given value.
+	virtual void timeAdvanceGrant( rti1516::LogicalTime const &_theTime )
+		throw (
+			rti1516::InvalidLogicalTime,
+			rti1516::JoinedFederateIsNotInTimeAdvancingState,
+			rti1516::FederateInternalError
+		);
+};
+
+#endif // FEDERATE_H
\ No newline at end of file
diff -U 3 -H -d -r -N -x 'install/*' -x 'build/*' -- original/applications/HLA_TestsSuite/terminal.cpp cvsrep/applications/HLA_TestsSuite/terminal.cpp
--- original/applications/HLA_TestsSuite/terminal.cpp	1970-01-01 03:00:00.000000000 +0300
+++ cvsrep/applications/HLA_TestsSuite/terminal.cpp	2011-02-27 14:13:27.000000000 +0300
@@ -0,0 +1,195 @@
+#include <iostream>
+#include <string.h>
+#include <limits>
+
+#include "terminal.h"
+
+// #define DISABLE_TIME_MANAGEMENT
+
+Terminal::Terminal(std::wstring _federatoinName, std::wstring _fddName):
+Federate( L"Terminal", _federatoinName, _fddName ) {
+}
+
+void Terminal::getHandles() {
+	out << "getting handle for interactions..." << std::endl;
+	bcvmMessageH = rtiamb->getInteractionClassHandle( L"bcvmMessage" );
+	terminalMessageH = rtiamb->getInteractionClassHandle( L"terminalMessage" );
+	out << "succeeded." << std::endl;
+	
+	out << "getting handle for interaction parameters..." << std::endl;
+	bcvmXH = rtiamb->getParameterHandle( bcvmMessageH, L"bcvmX" );
+	bcvmIdH = rtiamb->getParameterHandle( bcvmMessageH, L"bcvmId" );
+	terminalXH = rtiamb->getParameterHandle( terminalMessageH, L"terminalX" );
+	terminalIdH = rtiamb->getParameterHandle( terminalMessageH, L"terminalId" );	
+	out << "succeeded." << std::endl;
+	
+	terminalMessageMap.insert(std::make_pair( terminalXH, any2var(terminalX) ));
+	terminalMessageMap.insert(std::make_pair( terminalIdH, federateHandle.encode() ));
+}
+
+/*! Initialises Terminal
+ * \msc
+ * Terminal,Federate,RTI;
+ * Terminal=>Federate [label="subscribeWrapper"];
+ * Federate=>RTI [label="subscribeInteractionClass"];
+ * Federate<<RTI;
+ * Terminal<<Federate;
+ * Terminal=>Federate [label="publichWrapper"];
+ * Federate=>RTI [label="publishInteractionClass"];
+ * Federate<<RTI;
+ * Terminal<<Federate;
+ * Terminal=>Federate [label="enableConstrainedModeWrapper"];
+ * Federate<<RTI;
+ * ...;
+ * --- [label="waiting for corresponding callback"];
+ * Federate=>RTI [label="evokeCallback"];
+ * Federate=>RTI [label="enableTimeConstrained"];
+ * Federate<-RTI [label="timeConstrainedEnabled"];
+ * Federate>>RTI;
+ * Federate<<RTI;
+ * Terminal<<Federate;
+ * Terminal=>Federate [label="enableRegulationModeWrapper"];
+ * Federate<<RTI;
+ * ...;
+ * --- [label="waiting for corresponding callback"];
+ * Federate=>RTI [label="evokeCallback"];
+ * Federate=>RTI [label="enableTimeRegulation"];
+ * Federate<-RTI [label="timeRegulationEnabled"];
+ * Federate>>RTI;
+ * Federate<<RTI;
+ * Terminal<<Federate;
+ * \endmsc
+ */
+void Terminal::customInit() {
+	terminalX = 10;
+	subscribeWrapper( bcvmMessageH );
+	publishWrapper( terminalMessageH );
+	#ifndef DISABLE_TIME_MANAGEMENT
+	lookahead = 10;
+	enableConstrainedModeWrapper();
+	enableRegulationModeWrapper();
+	#endif
+}
+
+/*! Main terminal simulation loop.
+ * \msc
+ * Terminal,Federate,RTI;
+ * Terminal=>Federate [label="sendTSOWrapper"];
+ * Federate=>RTI [label="sendInteraction"];
+ * Federate<<RTI;
+ * Terminal=>Federate [label="nextMessageWrapper"];
+ * Federate=>RTI [label="nextMessageRequest"];
+ * Federate<<RTI;
+ * Terminal<<Federate;
+ * --- [label="waiting for reply"];
+ * ...;
+ * Terminal=>Federate [label="tickWrapper"];
+ * Federate=>RTI [label="evokeCallback"];
+ * Federate<-RTI [label="timeAdvanceGrant"];
+ * Federate>>RTI;
+ * Federate<<RTI;
+ * Terminal=>Federate [label="tickWrapper"];
+ * Federate=>RTI [label="evokeCallback"];
+ * Federate<-RTI [label="receiveInteraction"];
+ * Federate>>RTI;
+ * Federate<<RTI;
+ * \endmsc
+ */
+void Terminal::loop() {
+#ifndef DISABLE_TIME_MANAGEMENT
+	for( ; terminalX > 0; --terminalX ) {
+		granted = received = false;
+		terminalMessageMap.at( terminalXH ) = any2var( terminalX );
+		sendTSOWrapper( terminalMessageH, terminalMessageMap, logicalTime + lookahead, L"TERMINAL MESSAGE" );
+		nextMessageWrapper( std::numeric_limits<double>::max() );
+		for( ; !(granted && received); tickWrapper( 1 ) );
+	}
+#else
+	for( ; terminalX > 0; --terminalX ) {
+		received = false;
+		terminalMessageMap.at(terminalXH) = any2var( terminalX );
+		sendROWrapper( terminalMessageH, terminalMessageMap, L"TERMINAL MESSAGE" );
+		for( ; !received; tickWrapper() );
+	}
+#endif
+}
+
+//! Callback : receive interaction
+void Terminal::receiveInteraction(
+	rti1516::InteractionClassHandle _theInteraction,
+	rti1516::ParameterHandleValueMap const &_theParameterValues,
+	rti1516::VariableLengthData const &_theUserSuppliedTag,
+	rti1516::OrderType _sentOrder,
+	rti1516::TransportationType _theType
+) throw (
+		rti1516::InteractionClassNotRecognized,
+		rti1516::InteractionParameterNotRecognized,
+		rti1516::InteractionClassNotSubscribed,
+		rti1516::FederateInternalError
+	) {
+	out << "message tagged as " << var2str<wchar_t>( _theUserSuppliedTag ) << " received." << std::endl;
+	out << "message sent order type is " << ((_sentOrder==rti1516::TIMESTAMP)?"TSO":"RO") << std::endl;
+
+	if ( _theInteraction != bcvmMessageH )
+		throw rti1516::InteractionClassNotRecognized( L"unknown interaction received" );
+	rti1516::ParameterHandleValueMap::const_iterator end = _theParameterValues.end();
+	if ( _theParameterValues.find( bcvmIdH ) == end || _theParameterValues.find( bcvmXH ) == end )
+		throw rti1516::FederateInternalError( L"interaction does not have sufficient parameter set" );
+	out << "message body is correct" <<std::endl;
+	
+	// cancelling another's messages
+	if ( var2str<char>(_theParameterValues.at(bcvmIdH)) != var2str<char>(federateHandle.encode()) ) {
+		out << "another's message received - cancelling." << std::endl;
+		return;
+	}
+	
+	// State changing
+	var2any( _theParameterValues.at(bcvmXH), terminalX );
+	out << "X = " << terminalX << std::endl;
+	received = true;
+}
+
+void Terminal::receiveInteraction(
+	rti1516::InteractionClassHandle _theInteraction,
+	rti1516::ParameterHandleValueMap const &_theParameterValues,
+	rti1516::VariableLengthData const &_theUserSuppliedTag,
+	rti1516::OrderType _sentOrder,
+	rti1516::TransportationType _theType,
+	rti1516::LogicalTime const &_theTime,
+	rti1516::OrderType _receivedOrder,
+	rti1516::MessageRetractionHandle _theHandle
+)
+	throw (
+		rti1516::InteractionClassNotRecognized,
+		rti1516::InteractionParameterNotRecognized,
+		rti1516::InteractionClassNotSubscribed,
+		rti1516::InvalidLogicalTime,
+		rti1516::FederateInternalError
+	) {
+	out << "message tagged as " << var2str<wchar_t>( _theUserSuppliedTag ) << " received." << std::endl;
+	out << "message receive order type is " << ((_receivedOrder == rti1516::TIMESTAMP)?"TSO":"RO") << std::endl;
+	out << "message timestamp is " << ((RTI1516fedTime*)&_theTime)->getFedTime() << std::endl;
+
+	if ( _theInteraction != bcvmMessageH )
+		throw rti1516::InteractionClassNotRecognized( L"unknown interaction received" );
+	rti1516::ParameterHandleValueMap::const_iterator end = _theParameterValues.end();
+	if ( _theParameterValues.find( bcvmIdH ) == end || _theParameterValues.find( bcvmXH ) == end )
+		throw rti1516::FederateInternalError( L"interaction does not have sufficient parameter set" );
+	out << "message body is correct" <<std::endl;
+	
+	// cancelling another's messages
+	if ( var2str<char>(_theParameterValues.at(bcvmIdH)) != var2str<char>(federateHandle.encode()) ) {
+		out << "another's message received - cancelling." << std::endl;
+		return;
+	}
+	
+	// State changing
+	var2any( _theParameterValues.at(bcvmXH), terminalX );
+	out << "X = " << terminalX << std::endl;
+	received = true;
+}
+
+int main( int argc, char **argv ) {
+	Terminal terminal( L"BCVMTest", L"BCVMTest.fed" );
+	terminal.execute();
+}
\ No newline at end of file
diff -U 3 -H -d -r -N -x 'install/*' -x 'build/*' -- original/applications/HLA_TestsSuite/terminal.h cvsrep/applications/HLA_TestsSuite/terminal.h
--- original/applications/HLA_TestsSuite/terminal.h	1970-01-01 03:00:00.000000000 +0300
+++ cvsrep/applications/HLA_TestsSuite/terminal.h	2011-02-27 14:19:43.000000000 +0300
@@ -0,0 +1,87 @@
+/*! \file
+ * File includes definition of terminal federate.
+ * Terminal sends data to the onboard central computer (so called BCVM)
+ * receives its reply and decrements counter iteratively.
+ * 
+ * \author Eugene Chemeritskiy
+ * \date 25 FEB 2011
+ */
+
+#pragma once
+#ifndef TERMINAL_H
+#define TERMINAL_H
+
+#include "federate.h"
+
+/*! Terminal federate class.
+ * 
+ * Terminal loop starts after full synchronisation of federate execution. 
+ * Terminal sends interaction (terminal message) to onboard central computer (BCVM).
+ * Its body contains integer parameter (during the first iteration its value equals
+ * to the one assigned on initialisation) and unique terminal id (its federation handle).
+ * Then terminal waits for reply interaction (bcvmMessage) from BCVM.
+ * The body of this message should be a copy of sent data.
+ * Then received integer parameter value is decremented and
+ * terminal steps to the next cycle iteration.
+ */
+class Terminal : public Federate {
+private:
+	rti1516::ParameterHandleValueMap terminalMessageMap;
+	rti1516::InteractionClassHandle terminalMessageH;
+	rti1516::ParameterHandle terminalXH;
+	rti1516::ParameterHandle terminalIdH;
+	int terminalX;
+	
+	rti1516::InteractionClassHandle bcvmMessageH;
+	rti1516::ParameterHandle bcvmXH;
+	rti1516::ParameterHandle bcvmIdH;
+	
+	void getHandles();
+	void customInit();
+	void loop();
+
+public:
+	Terminal( std::wstring _federatoinName, std::wstring _fddName);
+	virtual ~Terminal() throw () {};
+
+	//========================================================
+	// FEDERATE AMBASSADOR CALLBACKS
+	//========================================================
+
+	//--------------------------------------------------------
+	// Object management
+	
+	virtual void receiveInteraction( 
+		rti1516::InteractionClassHandle theInteraction,
+		rti1516::ParameterHandleValueMap const & theParameterValues,
+		rti1516::VariableLengthData const & theUserSuppliedTag,
+		rti1516::OrderType sentOrder,
+		rti1516::TransportationType theType
+	)
+		throw (
+			rti1516::InteractionClassNotRecognized,
+			rti1516::InteractionParameterNotRecognized,
+			rti1516::InteractionClassNotSubscribed,
+			rti1516::FederateInternalError
+		);
+		
+	virtual void receiveInteraction(
+		rti1516::InteractionClassHandle _theInteraction,
+		rti1516::ParameterHandleValueMap const &_theParameterValues,
+		rti1516::VariableLengthData const &_theUserSuppliedTag,
+		rti1516::OrderType _sentOrder,
+		rti1516::TransportationType vtheType,
+		rti1516::LogicalTime const &_theTime,
+		rti1516::OrderType _receivedOrder,
+		rti1516::MessageRetractionHandle _theHandle
+	)
+		throw (
+			rti1516::InteractionClassNotRecognized,
+			rti1516::InteractionParameterNotRecognized,
+			rti1516::InteractionClassNotSubscribed,
+			rti1516::InvalidLogicalTime,
+			rti1516::FederateInternalError
+		);
+};
+
+#endif // TERMINAL_H
\ No newline at end of file
