def conditional_precedence_reserving_mutation(problem, child, probability): new_child = Heuristics.mutation_operation(child, probability) new_child2 = Heuristics.mutation_machine(new_child, probability) return min([child, new_child, new_child2], key=lambda x: Chromosome.compute_makespan(x, problem))
def precedence_reserving_mutation(problem, child, probability): new_child = Heuristics.mutation_operation(child, probability) new_child2 = Heuristics.mutation_machine(new_child, probability) return new_child2