aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsjpark <sjpark@amazon.com>2023-10-27 14:02:25 -0700
committersjpark <sjpark@amazon.com>2023-10-27 14:02:25 -0700
commit883cb8f9d87dd2702fe59a43ea1699390754a599 (patch)
tree5f78c239fadd85206c30a307f9da58c4bf47602d
parentbef8ce644cd526455b3d7ad35f23b2e89d47cab1 (diff)
downloaddamon-hack-883cb8f9d87dd2702fe59a43ea1699390754a599.tar.gz
idea/autotune_sim: Ignore consecutive success
Signed-off-by: sjpark <sjpark@amazon.com>
-rwxr-xr-xideas/autotune_sim/autotune_sim.py7
1 files changed, 1 insertions, 6 deletions
diff --git a/ideas/autotune_sim/autotune_sim.py b/ideas/autotune_sim/autotune_sim.py
index 5b2ea6d..52ddbf6 100755
--- a/ideas/autotune_sim/autotune_sim.py
+++ b/ideas/autotune_sim/autotune_sim.py
@@ -49,16 +49,11 @@ def run_simulation(print_for_plot):
target_in_error = 5
tuner = Tuner(the_algorithm, goal)
- nr_consecutive_in_target = 0
if print_for_plot:
print('%d_%d_%d_%d' % (a, b, quota, answer))
for i in range(max_steps):
score = score_of(quota, a, b, normal_error_percent)
if abs(score - goal) / goal * 100 < target_error:
- nr_consecutive_in_target += 1
- else:
- nr_consecutive_in_target = 0
- if nr_consecutive_in_target == target_in_error:
break
quota = tuner.get_next_quota(score)
if print_for_plot:
@@ -68,7 +63,7 @@ def run_simulation(print_for_plot):
print()
if i == max_steps - 1:
return -1
- return i - nr_consecutive_in_target
+ return i
def main():
parser = argparse.ArgumentParser()