Skip to content

Commit

Permalink
change mutation_type to mutation_name in parent_operator
Browse files Browse the repository at this point in the history
  • Loading branch information
kasyanovse committed Dec 27, 2023
1 parent 8735129 commit 80d51b4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion golem/core/optimisers/genetic/operators/mutation.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,12 @@ 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_type,
operators=mutation_name,
parent_individuals=individual)
individual = Individual(new_graph, parent_operator,
metadata=self.requirements.static_individual_metadata)
Expand Down

0 comments on commit 80d51b4

Please sign in to comment.