certi-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[certi-cvs] certi libRTI/RTIambPrivateRefs.cc RTIA/TimeMana...


From: certi-cvs
Subject: [certi-cvs] certi libRTI/RTIambPrivateRefs.cc RTIA/TimeMana...
Date: Tue, 21 Apr 2009 13:54:03 +0000

CVSROOT:        /sources/certi
Module name:    certi
Changes by:     Pierre Siron <siron>    09/04/21 13:54:03

Modified files:
        libRTI         : RTIambPrivateRefs.cc 
        RTIA           : TimeManagement.cc 

Log message:
        Use of epsilon2 to implement the zero lookahead features (NARA & TARA).

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/certi/libRTI/RTIambPrivateRefs.cc?cvsroot=certi&r1=3.18&r2=3.19
http://cvs.savannah.gnu.org/viewcvs/certi/RTIA/TimeManagement.cc?cvsroot=certi&r1=3.47&r2=3.48

Patches:
Index: libRTI/RTIambPrivateRefs.cc
===================================================================
RCS file: /sources/certi/certi/libRTI/RTIambPrivateRefs.cc,v
retrieving revision 3.18
retrieving revision 3.19
diff -u -b -r3.18 -r3.19
--- libRTI/RTIambPrivateRefs.cc 8 Apr 2009 10:47:20 -0000       3.18
+++ libRTI/RTIambPrivateRefs.cc 21 Apr 2009 13:54:02 -0000      3.19
@@ -19,7 +19,7 @@
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
 // USA
 //
-// $Id: RTIambPrivateRefs.cc,v 3.18 2009/04/08 10:47:20 approx Exp $
+// $Id: RTIambPrivateRefs.cc,v 3.19 2009/04/21 13:54:02 siron Exp $
 // ----------------------------------------------------------------------------
 
 #include <config.h>
@@ -403,6 +403,11 @@
           throw RTI::RTIinternalError(msg->getExceptionReason());
       } break ;
 
+      case e_InvalidLookahead: {
+          D.Out(pdExcept, "Throwing e_InvalidLookahead.");
+          throw RTI::InvalidLookahead(msg->getExceptionReason());
+      } break ;
+
       case e_InvalidObjectHandle: {
           D.Out(pdExcept, "Throwing e_InvalidObjectHandle exception.");
           throw RTI::RTIinternalError(msg->getExceptionReason());
@@ -907,4 +912,4 @@
     }
 }
 
-// $Id: RTIambPrivateRefs.cc,v 3.18 2009/04/08 10:47:20 approx Exp $
+// $Id: RTIambPrivateRefs.cc,v 3.19 2009/04/21 13:54:02 siron Exp $

Index: RTIA/TimeManagement.cc
===================================================================
RCS file: /sources/certi/certi/RTIA/TimeManagement.cc,v
retrieving revision 3.47
retrieving revision 3.48
diff -u -b -r3.47 -r3.48
--- RTIA/TimeManagement.cc      8 Apr 2009 10:47:18 -0000       3.47
+++ RTIA/TimeManagement.cc      21 Apr 2009 13:54:02 -0000      3.48
@@ -18,7 +18,7 @@
 // along with this program ; if not, write to the Free Software
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 //
-// $Id: TimeManagement.cc,v 3.47 2009/04/08 10:47:18 approx Exp $
+// $Id: TimeManagement.cc,v 3.48 2009/04/21 13:54:02 siron Exp $
 // ----------------------------------------------------------------------------
 
 #include <config.h>
@@ -33,6 +33,7 @@
 
 PrettyDebug D("RTIA_TM", __FILE__);
 static PrettyDebug G("GENDOC",__FILE__) ;
+const double epsilon2 = 1.0e-4 ;
 
 }
 
@@ -503,6 +504,7 @@
         _type_granted_state = AFTER_TAR_OR_NER ;  // will be
 
         if (_lookahead_courant == 0.0) {
+           _lookahead_courant == epsilon2 ;
            _type_granted_state = AFTER_TAR_OR_NER_WITH_ZERO_LK ;
         }
 
@@ -587,8 +589,12 @@
     // Verifications
 
     if (lookahead < 0.0)
-        e = e_InvalidFederationTimeDelta ;
+        e = e_InvalidLookahead ;
 
+    if (lookahead == epsilon2) {
+       cout << "Bad value of lookahead due to a zero lookahead implementation 
trick" << endl;
+       e = e_RTIinternalError ;
+    }
 
     if (e == e_NO_EXCEPTION) {
         _lookahead_courant = lookahead ;
@@ -885,6 +891,9 @@
     D.Out(pdRegister, "timeAdvanceGrant sent to federate (time = %f).",
           req.getFederationTime().getTime());
 
+    if (_lookahead_courant == epsilon2)
+        _lookahead_courant = 0.0 ;
+
     _tick_state = TICK_NEXT;  // indicate the callback was processed
 
     comm->requestFederateService(&req);
@@ -923,6 +932,7 @@
         _type_granted_state = AFTER_TAR_OR_NER ;  // will be
 
         if (_lookahead_courant == 0.0) {         
+           _lookahead_courant = epsilon2 ;
            _type_granted_state = AFTER_TAR_OR_NER_WITH_ZERO_LK ;
         }
 
@@ -979,4 +989,4 @@
 
 }} // namespaces
 
-// $Id: TimeManagement.cc,v 3.47 2009/04/08 10:47:18 approx Exp $
+// $Id: TimeManagement.cc,v 3.48 2009/04/21 13:54:02 siron Exp $




reply via email to

[Prev in Thread] Current Thread [Next in Thread]