From eb45d524a8ea5f612d9734f0415261513985c74f Mon Sep 17 00:00:00 2001 From: Durk Talsma Date: Tue, 31 Aug 2010 13:21:30 +0200 Subject: [PATCH] Provide an initial heuristic for airports for which we haven't collected any usage data yet. --- src/Traffic/Schedule.cxx | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/Traffic/Schedule.cxx b/src/Traffic/Schedule.cxx index 8b193550b..e86cbcf24 100644 --- a/src/Traffic/Schedule.cxx +++ b/src/Traffic/Schedule.cxx @@ -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);