Skip to content

Commit 98e54d8

Browse files
committed
Merge branch 'dev'
2 parents cc1ffdd + efb1982 commit 98e54d8

3 files changed

Lines changed: 10 additions & 2 deletions

File tree

moead_framework/algorithm/combinatorial/moead.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ def __init__(self, problem,
1515
weight_file,
1616
termination_criteria=None,
1717
number_of_crossover_points=2,
18+
mutation_probability=1,
1819
mating_pool_selector=None,
1920
genetic_operator=None,
2021
parent_selector=None,
@@ -39,6 +40,7 @@ def __init__(self, problem,
3940
offspring_generator=offspring_generator,
4041
weight_file=weight_file)
4142
self.number_of_crossover_points = number_of_crossover_points
43+
self.mutation_probability = mutation_probability
4244

4345
if genetic_operator is None:
4446
self.genetic_operator = CrossoverAndMutation

moead_framework/core/offspring_generator/offspring_generator.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,14 @@ def run(self, population_indexes):
1818
else:
1919
crossover_point = None
2020

21+
if hasattr(self.algorithm, 'mutation_probability'):
22+
mutation_probability = self.algorithm.mutation_probability
23+
else:
24+
mutation_probability = None
25+
2126
y_sol = self.algorithm.genetic_operator(solutions=parents_solutions,
22-
crossover_points=crossover_point
27+
crossover_points=crossover_point,
28+
mutation_probability=mutation_probability
2329
).run()
2430

2531
return self.algorithm.problem.generate_solution(array=y_sol)

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
setuptools.setup(
77
name="moead-framework",
8-
version="0.5.7",
8+
version="0.5.7.1",
99
author="Geoffrey Pruvost",
1010
author_email="geoffrey@pruvost.xyz",
1111
description="MOEA/D Framework in Python 3",

0 commit comments

Comments
 (0)