]> git.mxchange.org Git - flightgear.git/commitdiff
-Revert to the original design. It still appearch to yield the best scheduling results.
authorDurk Talsma <durktals@gmail.com>
Mon, 10 Oct 2011 21:03:57 +0000 (23:03 +0200)
committerDurk Talsma <durktals@gmail.com>
Mon, 10 Oct 2011 21:03:57 +0000 (23:03 +0200)
src/Traffic/Schedule.cxx
src/Traffic/TrafficMgr.cxx

index 1af0ca112a130b60a0a8ecce2100b22b3c8af966..39e870c46d3c2ab402f7da48cdd0552a11edfecb 100644 (file)
@@ -379,20 +379,11 @@ void FGAISchedule::scheduleFlights(time_t now)
   SG_LOG(SG_GENERAL, SG_BULK, "Scheduling Flights for : " << modelPath << " " <<  registration << " " << homePort);
   FGScheduledFlight *flight = NULL;
   do {
-    if (currentDestination.empty()) {
-        //flight = findAvailableFlight(userPort, flightIdentifier, now, (now+1800));
-        if (!flight)
-            flight = findAvailableFlight(currentDestination, flightIdentifier);
-    } else {
-        flight = findAvailableFlight(currentDestination, flightIdentifier);
-    }
+    flight = findAvailableFlight(currentDestination, flightIdentifier);
     
     if (!flight) {
       break;
     }
-    if (startingPort.empty()) {
-        startingPort = flight->getDepartureAirport()->getId();
-    }
 
    
     currentDestination = flight->getArrivalAirport()->getId();
@@ -423,7 +414,7 @@ void FGAISchedule::scheduleFlights(time_t now)
                              << "  "        << arrT << ":");
   
     flights.push_back(flight);
-  } while (currentDestination != startingPort);
+  } while (currentDestination != homePort);
   SG_LOG(SG_GENERAL, SG_BULK, " Done ");
 }
 
index 8870aa66f895fe5e3c0b9248cf62b0d04d2fee53..44e85676d4e8dadb55251779aedd6a2018701e5d 100644 (file)
@@ -270,10 +270,6 @@ void FGTrafficManager::update(double /*dt */ )
     //cerr << "Processing << " << (*currAircraft)->getRegistration() << " with score " << (*currAircraft)->getScore() << endl;
     if (!((*currAircraft)->update(now, userCart))) {
         (*currAircraft)->taint();
-        // NOTE: With traffic manager II, this statement below is no longer true
-        // after proper initialization, we shouldnt get here.
-        // But let's make sure
-        //SG_LOG( SG_GENERAL, SG_ALERT, "Failed to update aircraft schedule in traffic manager");
     }
     currAircraft++;
 }