From 403219a7ba46439b38e56c4c7cb99938a12611cd Mon Sep 17 00:00:00 2001 From: SimpleArt <71458112+SimpleArt@users.noreply.github.com> Date: Sun, 13 Dec 2020 12:11:09 -0500 Subject: [PATCH] Fixed stochastic_arithmetic inflation --- src/parent_selection/parent_selection_methods.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/parent_selection/parent_selection_methods.py b/src/parent_selection/parent_selection_methods.py index fc2396a..5b33577 100644 --- a/src/parent_selection/parent_selection_methods.py +++ b/src/parent_selection/parent_selection_methods.py @@ -153,8 +153,8 @@ class Parent_Selection: # etc. # with an inflation of (1-selection probability) * sum of weights - sum_of_weights = round(len(ga.population) * (len(ga.population)+1) / 2) - inflation = (1-ga.selection_probability) * sum_of_weights + average_weight = (len(ga.population)+1) // 2 + inflation = (1-ga.selection_probability) * average_weight weights = [ i + inflation