From: Durk Talsma Date: Mon, 10 Oct 2011 21:03:57 +0000 (+0200) Subject: -Revert to the original design. It still appearch to yield the best scheduling results. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=020d6a6363279128a3cbda7bd4aadd7532dbe6d2;p=flightgear.git -Revert to the original design. It still appearch to yield the best scheduling results. --- diff --git a/src/Traffic/Schedule.cxx b/src/Traffic/Schedule.cxx index 1af0ca112..39e870c46 100644 --- a/src/Traffic/Schedule.cxx +++ b/src/Traffic/Schedule.cxx @@ -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 "); } diff --git a/src/Traffic/TrafficMgr.cxx b/src/Traffic/TrafficMgr.cxx index 8870aa66f..44e85676d 100644 --- a/src/Traffic/TrafficMgr.cxx +++ b/src/Traffic/TrafficMgr.cxx @@ -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++; }