Skip to content

Commit

Permalink
Fix setting parent operation in mutation (#261)
Browse files Browse the repository at this point in the history
  • Loading branch information
YamLyubov authored Jan 25, 2024
1 parent 6bb42c7 commit 497528b
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions golem/core/optimisers/genetic/operators/mutation.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,8 @@ def _mutation(self, individual: Individual) -> Tuple[Individual, bool]:
new_graph = self._apply_mutations(new_graph, mutation_type)
is_correct_graph = self.graph_generation_params.verifier(new_graph)
if is_correct_graph:
if isinstance(mutation_type, MutationTypesEnum):
mutation_name = mutation_type.name
else:
mutation_name = mutation_type.__name__
parent_operator = ParentOperator(type_='mutation',
operators=mutation_name,
operators=mutation_type,
parent_individuals=individual)
individual = Individual(new_graph, parent_operator,
metadata=self.requirements.static_individual_metadata)
Expand Down

0 comments on commit 497528b

Please sign in to comment.