From 4668e2e7c468a4d1732873946eaea2a02b601069 Mon Sep 17 00:00:00 2001 From: Anton Beloglazov Date: Mon, 26 Nov 2012 15:59:11 +1100 Subject: [PATCH] Fixed MHOD: first updating windows, then selecting estimates --- neat/locals/overload/mhod/core.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/neat/locals/overload/mhod/core.py b/neat/locals/overload/mhod/core.py index 03d749b..5c4853c 100644 --- a/neat/locals/overload/mhod/core.py +++ b/neat/locals/overload/mhod/core.py @@ -118,13 +118,6 @@ def mhod(state_config, otf, window_sizes, bruteforce_step, learning_steps, total_time = len(utilization) state_vector = build_state_vector(state_config, utilization) current_state = get_current_state(state_vector) - selected_windows = estimation.select_window( - state['variances'], - state['acceptable_variances'], - window_sizes) - p = estimation.select_best_estimates( - state['estimate_windows'], - selected_windows) state['request_windows'] = estimation.update_request_windows( state['request_windows'], @@ -144,6 +137,14 @@ def mhod(state_config, otf, window_sizes, bruteforce_step, learning_steps, state['previous_state']) state['previous_state'] = current_state + selected_windows = estimation.select_window( + state['variances'], + state['acceptable_variances'], + window_sizes) + p = estimation.select_best_estimates( + state['estimate_windows'], + selected_windows) + log.debug('MHOD utilization:' + str(utilization)) if len(utilization) >= learning_steps: state_history = utilization_to_states(state_config, utilization)