MHOD: removed the auto-false when the current state is not n

This commit is contained in:
Anton Beloglazov 2012-12-21 15:45:48 +11:00
parent b323c08213
commit 283c4a9638
2 changed files with 3 additions and 2 deletions

View File

@ -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'])

View File

@ -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'] = []