Index: TimeManagement.cc
===================================================================
RCS file: /sources/certi/certi/RTIA/TimeManagement.cc,v
retrieving revision 3.45
diff -u -r3.45 TimeManagement.cc
--- TimeManagement.cc	18 Sep 2008 14:41:27 -0000	3.45
+++ TimeManagement.cc	13 Mar 2009 15:00:33 -0000
@@ -100,7 +100,7 @@
     msg.setDate(heure_logique);
     heure_logique += _lookahead_courant ;
 
-    if (heure_logique > lastNullMessageDate) {        
+    if (heure_logique > lastNullMessageDate) {
         msg.federation = fm->_numero_federation ;
         msg.federate = fm->federate ;
         msg.setDate(heure_logique) ; // ? See 6 lines upper !
@@ -199,7 +199,7 @@
       }
 
       case NetworkMessage::PROVIDE_ATTRIBUTE_VALUE_UPDATE:
-      { 
+      {
       om->provideAttributeValueUpdate(msg.object,
                                       msg.handleArray,
                                       msg.handleArraySize,
@@ -368,7 +368,7 @@
 
       default:
 	std::stringstream errorMsg;
-        D.Out(pdExcept, "Unknown message type in executeFederateService.");        
+        D.Out(pdExcept, "Unknown message type in executeFederateService.");
 	errorMsg << "Unknown message <" <<  msg.getName() << " in executeFederateService.";
         throw RTIinternalError(errorMsg.str().c_str());
     }
@@ -490,18 +490,15 @@
     if (heure_logique < _heure_courante)
         e = e_FederationTimeAlreadyPassed ;
 
-    if (heure_logique < _heure_courante + _lookahead_courant)
-       e = e_InvalidFederationTime ;
-
     if (e == e_NO_EXCEPTION) {
 
         _type_granted_state = AFTER_TAR_OR_NER ;  // will be
 
-        // FIXME Erk-->Pierre 
+        // FIXME Erk-->Pierre
         // We were changing lookahead value to epsilon
         // when doing zero lookahead I'd rather handle
         // _any_ near-to-zero lookahead as ZERO_LK
-        if (0==RTIfedTime::fcmp(_lookahead_courant,0.0)) {           
+        if (0==RTIfedTime::fcmp(_lookahead_courant,0.0)) {
            _type_granted_state = AFTER_TAR_OR_NER_WITH_ZERO_LK ;
         }
 
@@ -529,9 +526,6 @@
     if (heure_logique < _heure_courante)
         e = e_FederationTimeAlreadyPassed ;
 
-    if (heure_logique < _heure_courante + _lookahead_courant)
-       e = e_InvalidFederationTime ;
-
     if (e == e_NO_EXCEPTION) {
         _type_granted_state = AFTER_TARA_OR_NERA ;  // will be
         _avancee_en_cours = NERA ;
@@ -564,7 +558,7 @@
     FederationTime dateTSO ;
     FederationTime dateMNET ;
     bool found ;
- 
+
     queues->nextTsoDate(found, dateTSO) ;
 
     if (!found)
@@ -626,7 +620,7 @@
         	msg.constrainedOn();
         } else {
         	msg.constrainedOff();
-        }        
+        }
 
         comm->sendMessage(&msg);
 
@@ -676,12 +670,12 @@
         	msg.regulatorOff();
         	D.Out(pdDebug,
         	      "REGULATOR OFF");
-        } 
-    // Modifier lookahead courant 
+        }
+    // Modifier lookahead courant
     _lookahead_courant = the_lookahead;
           D.Out(pdDebug,
     	        "New lookahead = %f",_lookahead_courant);
-    // faudrait peut etre remplacer heure courante par le temps en parametre      
+    // faudrait peut etre remplacer heure courante par le temps en parametre
         msg.setDate(_heure_courante + _lookahead_courant);
 
         comm->sendMessage(&msg);
@@ -698,7 +692,7 @@
 void
 TimeManagement::timeRegulationEnabled(FederationTime theTime, TypeException &e) {
     Message req;
-    
+
     D.Out(pdDebug,"Sending TIME_REGULATION_ENABLED to Federate");
     req.type = Message::TIME_REGULATION_ENABLED;
     req.setFederationTime(theTime);
@@ -854,7 +848,7 @@
                D.Out(pdDebug, "Logical time : %15.12f, LBTS : %15.12f, lookahead : %f.",
                      date_avancee, _LBTS, _lookahead_courant);
 
-            if ((date_avancee < _LBTS) || 
+            if ((date_avancee < _LBTS) ||
                ((date_avancee == _LBTS) && (_avancee_en_cours == TARA))) {
                 // send a timeAdvanceGrant to federate.
                 timeAdvanceGrant(date_avancee, e);
@@ -923,24 +917,16 @@
     /* logical_time <_heure_courante */
     if (RTIfedTime::fcmp(logical_time ,_heure_courante) < 0)
         e = e_FederationTimeAlreadyPassed ;
-    
-    /* logical_time < _heure_courante + _lookahead_courant */
-    if (RTIfedTime::fcmp(logical_time , _heure_courante + _lookahead_courant)<0) {
-    	
-    D.Out(pdDebug,"InvalidFederation time lkahead=%f, current=%f, requested=%f",
-    			_lookahead_courant,_heure_courante,logical_time);
-       e = e_InvalidFederationTime ;
-    }
 
     if (e == e_NO_EXCEPTION) {
 
         _type_granted_state = AFTER_TAR_OR_NER ;  // will be
 
-        // FIXME Erk-->Pierre 
+        // FIXME Erk-->Pierre
         // We were changing lookahead value to epsilon
         // when doing zero lookahead I'd rather handle
         // _any_ near-to-zero lookahead as ZERO_LK
-        if (0==RTIfedTime::fcmp(_lookahead_courant,0.0)) {         
+        if (0==RTIfedTime::fcmp(_lookahead_courant,0.0)) {
            _type_granted_state = AFTER_TAR_OR_NER_WITH_ZERO_LK ;
         }
 
@@ -973,9 +959,6 @@
     if (logical_time < _heure_courante)
         e = e_FederationTimeAlreadyPassed ;
 
-    if (logical_time < _heure_courante + _lookahead_courant)
-       e = e_InvalidFederationTime ;
-
     if (e == e_NO_EXCEPTION) {
 
         _type_granted_state = AFTER_TARA_OR_NERA ;  // will be

