Skip to content

Commit

Permalink
v0.5.2 : add parameter offspring_generator
Browse files Browse the repository at this point in the history
  • Loading branch information
geoffreyp committed Jul 6, 2020
1 parent a15b775 commit d773059
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
7 changes: 6 additions & 1 deletion moead_framework/algorithm/abstract_moead.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ def __init__(self, problem, max_evaluation, number_of_objective, number_of_weigh
parent_selector=None,
mating_pool_selector=None,
sps_strategy=None,
offspring_generator=None,
weight_file=None):
self.problem = problem
self.aggregation_function = aggregation_function()
Expand Down Expand Up @@ -50,7 +51,11 @@ def __init__(self, problem, max_evaluation, number_of_objective, number_of_weigh

self.genetic_operator = genetic_operator
self.parent_selector = parent_selector
self.offspring_generator = OffspringGeneratorGeneric(algorithm_instance=self)

if offspring_generator is None:
self.offspring_generator = OffspringGeneratorGeneric(algorithm_instance=self)
else:
self.offspring_generator = offspring_generator

@abstractmethod
def run(self, checkpoint=None):
Expand Down
2 changes: 2 additions & 0 deletions moead_framework/algorithm/combinatorial/moead.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ def __init__(self, problem,
genetic_operator=None,
parent_selector=None,
sps_strategy=None,
offspring_generator=None,
weight_file=None):

self.current_eval = 1
Expand All @@ -34,6 +35,7 @@ def __init__(self, problem,
mating_pool_selector=mating_pool_selector,
parent_selector=parent_selector,
sps_strategy=sps_strategy,
offspring_generator=offspring_generator,
weight_file=weight_file)
self.number_of_crossover_points = number_of_crossover_points

Expand Down
2 changes: 2 additions & 0 deletions moead_framework/algorithm/numerical/moead.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ def __init__(self, problem,
genetic_operator=None,
parent_selector=None,
sps_strategy=None,
offspring_generator=None,
weight_file=None):

self.current_eval = 1
Expand All @@ -34,6 +35,7 @@ def __init__(self, problem,
mating_pool_selector=mating_pool_selector,
parent_selector=parent_selector,
sps_strategy=sps_strategy,
offspring_generator=offspring_generator,
weight_file=weight_file)

if genetic_operator is None:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="moead-framework",
version="0.5.1",
version="0.5.2",
author="Geoffrey Pruvost",
author_email="geoffrey@pruvost.xyz",
description="MOEA/D Framework in Python 3",
Expand Down

0 comments on commit d773059

Please sign in to comment.