MHOD: removed the auto-false when the current state is not n
This commit is contained in:
parent
b323c08213
commit
283c4a9638
@ -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]))
|
log.debug('MHOD p[current_state]:' + str(p[current_state]))
|
||||||
|
|
||||||
if utilization_length >= learning_steps:
|
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(
|
policy = bruteforce.optimize(
|
||||||
bruteforce_step, 1.0, otf, (migration_time / time_step), ls, p,
|
bruteforce_step, 1.0, otf, (migration_time / time_step), ls, p,
|
||||||
state_vector, state['time_in_states'], state['time_in_state_n'])
|
state_vector, state['time_in_states'], state['time_in_state_n'])
|
||||||
|
@ -142,7 +142,7 @@ class Core(TestCase):
|
|||||||
expect(c).get_current_state.and_return(0).once()
|
expect(c).get_current_state.and_return(0).once()
|
||||||
decision, _ = c.mhod(state_config, otf, window_sizes, bruteforce_step,
|
decision, _ = c.mhod(state_config, otf, window_sizes, bruteforce_step,
|
||||||
learning_steps, time_step, migration_time, utilization, state)
|
learning_steps, time_step, migration_time, utilization, state)
|
||||||
self.assertFalse(decision)
|
self.assertTrue(decision)
|
||||||
|
|
||||||
with MockTransaction:
|
with MockTransaction:
|
||||||
state['previous_utilization'] = []
|
state['previous_utilization'] = []
|
||||||
|
Loading…
x
Reference in New Issue
Block a user