diff --git a/src/Generator/generator.py b/src/Generator/generator.py index 1d115b8..9642bdd 100644 --- a/src/Generator/generator.py +++ b/src/Generator/generator.py @@ -154,13 +154,13 @@ def correct_precedence(solution, idx): task = (new_start,) + task[1:] solution.insert(idx, task) -def generate(old_solution, steps): +def generate(old_solution, steps, percent=1): """ Generate a new solution from an existing solution with a specified number of max steps. """ solution = old_solution[:] - accept_percent = 1 + percent = 1 option = pull_fwd #do at least one pull while(steps > 0): solution = option(solution) @@ -168,7 +168,7 @@ def generate(old_solution, steps): break steps -= 1 select = random.randrange(0,100) - option = pull_fwd if (select - accept_percent) > 0 else accept + option = pull_fwd if (select - percent) > 0 else accept accept(solution) return solution