From 7d1b4d4537773d57061f1c36d71f4563829f5976 Mon Sep 17 00:00:00 2001 From: "Casper V. Kristensen" Date: Sun, 7 Apr 2019 03:04:26 +0200 Subject: [PATCH] Australia in Australia strat. --- server/nightr/strategies/miloStrats.py | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/server/nightr/strategies/miloStrats.py b/server/nightr/strategies/miloStrats.py index afe5af5..2b7903d 100644 --- a/server/nightr/strategies/miloStrats.py +++ b/server/nightr/strategies/miloStrats.py @@ -35,12 +35,20 @@ def australiaStrat(context : Context) -> Prediction: hour = t.hour p = Prediction() - if hour > 22 or hour < 6: - p.probability = 0.0 - p.reasons.append('It\'s night-time in Australia, so it must be day-time here.') + if context.in_australia: + if hour > 22 or hour < 6: + p.probability = 1.0 + p.reasons.append('It\'s night-time in Australia, and that\'s where we\'re at.') + else: + p.probability = 0.0 + p.reasons.append('It\'s day-time in Australia, and that\'s where we\'re at.') else: - p.probability = 1.0 - p.reasons.append('It\'s day-time in Australia, so it must be night-time here.') + if hour > 22 or hour < 6: + p.probability = 0.0 + p.reasons.append('It\'s night-time in Australia, so it must be day-time here.') + else: + p.probability = 1.0 + p.reasons.append('It\'s day-time in Australia, so it must be night-time here.') return p