]> git.mxchange.org Git - flightgear.git/blobdiff - src/Traffic/Schedule.cxx
Remove conditional compilation of ATCDCL
[flightgear.git] / src / Traffic / Schedule.cxx
index 8b193550b5b5858936a33965b95ed0eb4cc91364..cb7fafb3d73918cd6cae455d220bd2600c786fe0 100644 (file)
@@ -187,9 +187,6 @@ bool FGAISchedule::init()
 
 bool FGAISchedule::update(time_t now, const SGVec3d& userCart)
 { 
-  if (!fgGetBool("/sim/traffic-manager/enabled"))
-    return true;
-  
   time_t 
     totalTimeEnroute, 
     elapsedTimeEnroute,
@@ -364,10 +361,12 @@ void FGAISchedule::scheduleFlights()
     currentDestination = flight->getArrivalAirport()->getId();
     if (!initialized) {
         string departurePort = flight->getDepartureAirport()->getId();
+       //cerr << "Scheduled " << registration <<  " " << score << " for Flight " 
+       //     << flight-> getCallSign() << " from " << departurePort << " to " << currentDestination << endl;
         if (fgGetString("/sim/presets/airport-id") == departurePort) {
             hits++;
         }
-        runCount++;
+        //runCount++;
         initialized = true;
     }
   
@@ -497,6 +496,20 @@ double FGAISchedule::getSpeed()
   return speed;
 }
 
+void FGAISchedule::setScore   () 
+{ 
+    if (runCount) {
+        score = ((double) hits / (double) runCount);
+    } else {
+        if (homePort == fgGetString("/sim/presets/airport-id")) {
+            score = 0.1;
+        } else {
+            score = 0.0;
+        }
+    }
+    runCount++;
+}
+
 bool compareSchedules(FGAISchedule*a, FGAISchedule*b)
 { 
   return (*a) < (*b);