MHOD: run only if in state n
This commit is contained in:
parent
094b2aad1e
commit
6f51d51cce
@ -196,8 +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 p[current_state][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'])
|
||||
|
@ -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.assertTrue(decision)
|
||||
self.assertFalse(decision)
|
||||
|
||||
with MockTransaction:
|
||||
state['previous_utilization'] = []
|
||||
|
Loading…
Reference in New Issue
Block a user