From 283c4a96388ef1d02446897f3e9752f34e30f3d9 Mon Sep 17 00:00:00 2001 From: Anton Beloglazov Date: Fri, 21 Dec 2012 15:45:48 +1100 Subject: [PATCH] MHOD: removed the auto-false when the current state is not n --- neat/locals/overload/mhod/core.py | 3 ++- tests/locals/overload/mhod/test_core.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/neat/locals/overload/mhod/core.py b/neat/locals/overload/mhod/core.py index cc2dcfb..20a5f7c 100644 --- a/neat/locals/overload/mhod/core.py +++ b/neat/locals/overload/mhod/core.py @@ -196,7 +196,8 @@ def mhod(state_config, otf, window_sizes, bruteforce_step, learning_steps, log.debug('MHOD p[current_state]:' + str(p[current_state])) if utilization_length >= learning_steps: - if current_state == state_n and p[state_n][state_n] > 0: + # if current_state == state_n and p[state_n][state_n] > 0: + if p[current_state][state_n] > 0: policy = bruteforce.optimize( bruteforce_step, 1.0, otf, (migration_time / time_step), ls, p, state_vector, state['time_in_states'], state['time_in_state_n']) diff --git a/tests/locals/overload/mhod/test_core.py b/tests/locals/overload/mhod/test_core.py index 55aff13..da336bb 100644 --- a/tests/locals/overload/mhod/test_core.py +++ b/tests/locals/overload/mhod/test_core.py @@ -142,7 +142,7 @@ class Core(TestCase): expect(c).get_current_state.and_return(0).once() decision, _ = c.mhod(state_config, otf, window_sizes, bruteforce_step, learning_steps, time_step, migration_time, utilization, state) - self.assertFalse(decision) + self.assertTrue(decision) with MockTransaction: state['previous_utilization'] = []