]> git.mxchange.org Git - flightgear.git/commitdiff
Provide an initial heuristic for airports for which we haven't collected any usage...
authorDurk Talsma <durk@linux-iue5.site>
Tue, 31 Aug 2010 11:21:30 +0000 (13:21 +0200)
committerDurk Talsma <durk@linux-iue5.site>
Tue, 31 Aug 2010 11:21:30 +0000 (13:21 +0200)
src/Traffic/Schedule.cxx

index 8b193550b5b5858936a33965b95ed0eb4cc91364..e86cbcf243097940914a04d92e44afaa06a15377 100644 (file)
@@ -497,6 +497,19 @@ 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;
+        }
+    }
+}
+
 bool compareSchedules(FGAISchedule*a, FGAISchedule*b)
 { 
   return (*a) < (*b);