From da8a4ca1201cebf68ecf912b28fac8f31e9953f3 Mon Sep 17 00:00:00 2001 From: Anton Beloglazov Date: Fri, 25 Jan 2013 10:49:21 +1100 Subject: [PATCH] Added debug logging to the OTF algorithm --- neat/locals/overload/otf.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/neat/locals/overload/otf.py b/neat/locals/overload/otf.py index 44c433d..62c7700 100644 --- a/neat/locals/overload/otf.py +++ b/neat/locals/overload/otf.py @@ -85,6 +85,14 @@ def otf(otf, threshold, limit, migration_time, utilization, state): if len(utilization) < limit: decision = False else: + if log.isEnabledFor(logging.DEBUG): + log.debug('OTF overload steps:' + str(state['overload'])) + log.debug('OTF overload steps:' + str(state['total'])) + log.debug('OTF:' + str(state['overload'] / state['total'])) + log.debug('OTF + migration time:' + + str((migration_time + state['overload']) / \ + (migration_time + state['total']))) + decision = (migration_time + state['overload']) / \ (migration_time + state['total']) >= otf