1
0
Fork 0

-Revert to the original design. It still appearch to yield the best scheduling results.

This commit is contained in:
Durk Talsma 2011-10-10 23:03:57 +02:00
parent 835334bd4f
commit 020d6a6363
2 changed files with 2 additions and 15 deletions

View file

@ -379,20 +379,11 @@ void FGAISchedule::scheduleFlights(time_t now)
SG_LOG(SG_GENERAL, SG_BULK, "Scheduling Flights for : " << modelPath << " " << registration << " " << homePort); SG_LOG(SG_GENERAL, SG_BULK, "Scheduling Flights for : " << modelPath << " " << registration << " " << homePort);
FGScheduledFlight *flight = NULL; FGScheduledFlight *flight = NULL;
do { do {
if (currentDestination.empty()) { flight = findAvailableFlight(currentDestination, flightIdentifier);
//flight = findAvailableFlight(userPort, flightIdentifier, now, (now+1800));
if (!flight)
flight = findAvailableFlight(currentDestination, flightIdentifier);
} else {
flight = findAvailableFlight(currentDestination, flightIdentifier);
}
if (!flight) { if (!flight) {
break; break;
} }
if (startingPort.empty()) {
startingPort = flight->getDepartureAirport()->getId();
}
currentDestination = flight->getArrivalAirport()->getId(); currentDestination = flight->getArrivalAirport()->getId();
@ -423,7 +414,7 @@ void FGAISchedule::scheduleFlights(time_t now)
<< " " << arrT << ":"); << " " << arrT << ":");
flights.push_back(flight); flights.push_back(flight);
} while (currentDestination != startingPort); } while (currentDestination != homePort);
SG_LOG(SG_GENERAL, SG_BULK, " Done "); SG_LOG(SG_GENERAL, SG_BULK, " Done ");
} }

View file

@ -270,10 +270,6 @@ void FGTrafficManager::update(double /*dt */ )
//cerr << "Processing << " << (*currAircraft)->getRegistration() << " with score " << (*currAircraft)->getScore() << endl; //cerr << "Processing << " << (*currAircraft)->getRegistration() << " with score " << (*currAircraft)->getScore() << endl;
if (!((*currAircraft)->update(now, userCart))) { if (!((*currAircraft)->update(now, userCart))) {
(*currAircraft)->taint(); (*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++; currAircraft++;
} }