From: Durk Talsma Date: Tue, 31 Aug 2010 11:21:30 +0000 (+0200) Subject: Provide an initial heuristic for airports for which we haven't collected any usage... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=eb45d524a8ea5f612d9734f0415261513985c74f;p=flightgear.git Provide an initial heuristic for airports for which we haven't collected any usage data yet. --- 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);