aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsjpark <sjpark@amazon.com>2023-10-27 13:58:48 -0700
committersjpark <sjpark@amazon.com>2023-10-27 13:58:48 -0700
commitbef8ce644cd526455b3d7ad35f23b2e89d47cab1 (patch)
tree23cd50e76a3b1faa9ee56d9f63f317cde338f2df
parent15e32b2b22adbf00e76d9611ecd34be1c97a99e9 (diff)
downloaddamon-hack-bef8ce644cd526455b3d7ad35f23b2e89d47cab1.tar.gz
ideas/autotune_sim: Ensure random range is normal
Signed-off-by: sjpark <sjpark@amazon.com>
-rwxr-xr-xideas/autotune_sim/autotune_sim.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/ideas/autotune_sim/autotune_sim.py b/ideas/autotune_sim/autotune_sim.py
index 48605d9..5b2ea6d 100755
--- a/ideas/autotune_sim/autotune_sim.py
+++ b/ideas/autotune_sim/autotune_sim.py
@@ -30,7 +30,7 @@ def the_algorithm(goal, past_scores, past_quotas):
def score_of(input_, a, b, max_error_percent):
score_wo_err = input_ * a + b
- max_error_half = int(score_wo_err * max_error_percent / 100 / 2)
+ max_error_half = abs(int(score_wo_err * max_error_percent / 100 / 2))
return score_wo_err + random.randint(max_error_half * -1 , max_error_half)
def run_simulation(print_for_plot):