- string isHeavy;
- if (heavy) {
- isHeavy = "true";
- } else {
- isHeavy = "false";
- }
- /*
- cerr << "Traffic Dump AC," << homePort << "," << registration << "," << requiredAircraft
- << "," << acType << "," << livery << ","
- << airline << "," << offset << "," << radius << "," << flighttype << "," << isHeavy << "," << mdl << endl;*/
- int proportion =
- (int) (fgGetDouble("/sim/traffic-manager/proportion") * 100);
- int randval = rand() & 100;
- if (randval <= proportion) {
- if (fgGetBool("/sim/traffic-manager/dumpdata") == true) {
- SG_LOG(SG_GENERAL, SG_ALERT, "Traffic Dump AC," << homePort << "," << registration << "," << requiredAircraft
- << "," << acType << "," << livery << ","
- << airline << "," << m_class << "," << offset << "," << radius << "," << flighttype << "," << isHeavy << "," << mdl);
- }
- //scheduledAircraft.push_back(new FGAISchedule(mdl,
- // livery,
- // registration,
- // heavy,
- // acType,
- // airline,
- // m_class,
- // flighttype,
- // radius,
- // offset,
- // score,
- // flights));
- if (requiredAircraft == "") {
- char buffer[16];
- snprintf(buffer, 16, "%d", acCounter);
- requiredAircraft = buffer;
- }
- if (homePort == "") {
- homePort = departurePort;
- }
- scheduledAircraft.push_back(new FGAISchedule(mdl,
- livery,
- homePort,
- registration,
- requiredAircraft,
- heavy,
- acType,
- airline,
- m_class,
- flighttype,
- radius, offset));
-
- // while(flights.begin() != flights.end()) {
-// flights.pop_back();
-// }
- } else {
- cerr << "Skipping : " << randval;
- }
- acCounter++;
- requiredAircraft = "";
- homePort = "";
- //for (FGScheduledFlightVecIterator flt = flights.begin(); flt != flights.end(); flt++)
- // {
- // delete (*flt);
- // }
- //flights.clear();
- SG_LOG(SG_GENERAL, SG_BULK, "Reading aircraft : "
- << registration << " with prioritization score " << score);
- score = 0;