Started working on extended unit tests of the MHOD algorithm

This commit is contained in:
Anton Beloglazov 2012-12-03 20:36:52 +11:00
parent 663bf8a061
commit 1299ef2e03
2 changed files with 542 additions and 4 deletions

View File

@ -145,11 +145,19 @@ def mhod(state_config, otf, window_sizes, bruteforce_step, learning_steps,
state['estimate_windows'],
selected_windows)
# These two are saved for testing purposes
state['selected_windows'] = selected_windows
state['p'] = p
log.debug('MHOD utilization:' + str(utilization))
if len(utilization) >= learning_steps:
state_history = utilization_to_states(state_config, utilization)
time_in_states = total_time
time_in_state_n = get_time_in_state_n(state_config, state_history)
# These two are saved for testing purposes
state['time_in_states'] = time_in_states
state['time_in_state_n'] = time_in_state_n
log.debug('MHOD state_history:' + str(state_history))
log.debug('MHOD time_in_states:' + str(time_in_states))
log.debug('MHOD time_in_state_n:' + str(time_in_state_n))
@ -161,6 +169,8 @@ def mhod(state_config, otf, window_sizes, bruteforce_step, learning_steps,
policy = bruteforce.optimize(
bruteforce_step, 1.0, otf, (migration_time / time_step),
ls, p, state_vector, time_in_states, time_in_state_n)
# This is saved for testing purposes
state['policy'] = policy
log.debug('MHOD policy:' + str(policy))
command = issue_command_deterministic(policy)
log.debug('MHOD command:' + str(command))

File diff suppressed because one or more lines are too long