-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[joss-reviews#2974] Code duplication #18
Labels
Comments
geoffreyp
added a commit
that referenced
this issue
Feb 10, 2021
Thank you! |
geoffreyp
added
Next release : ready to merge
Ready for JOSS review
and removed
Next release : ready to merge
labels
Feb 10, 2021
def get_xtrem_index(self):
"""
get boundaries sub-problems
:return: {list<integer>} indexes of sub-problems
"""
xtrem_index = []
for i in range(self.algorithm.number_of_weight):
weight = self.algorithm.weights[i]
for j in range(self.algorithm.number_of_objective):
if weight[j] == 1:
xtrem_index.append(i)
break
return xtrem_index
def get_xtrem_index(self):
"""
get boundaries sub-problems
:return: {list<integer>} indexes of sub-problems
"""
xtrem_index = []
for i in range(self.algorithm.number_of_weight):
weight = self.algorithm.weights[i]
for j in range(self.algorithm.number_of_objective):
if weight[j] == 1:
xtrem_index.append(i)
break
return xtrem_index |
self.update_current_sub_problem(sub_problem=i)
self.mating_pool = self.mating_pool_selection(sub_problem=i)[:]
y = self.generate_offspring(population=self.mating_pool)
y = self.repair(solution=y)
self.update_z(solution=y)
self.update_solutions(solution=y, aggregation_function=self.aggregation_function, sub_problem=i)
self.current_eval += 1
self.update_current_sub_problem(sub_problem=i)
self.mating_pool = self.mating_pool_selection(sub_problem=i)[:]
y = self.generate_offspring(population=self.mating_pool)
y = self.repair(solution=y)
self.update_z(solution=y)
self.update_solutions(solution=y, aggregation_function=self.aggregation_function, sub_problem=i)
self.current_eval += 1 |
Pull request #67 |
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Related: openjournals/joss-reviews#2974
If I am not mistaken, the following code blocks are exactly the same. Consider a refactoring.
numerical/moead.py (48–91)
combinatorial/moead.py (52–95)
The text was updated successfully, but these errors were encountered: