forked from anyoptimization/pymoo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added GodenSectionSearch, RVEA and GDE3
- Loading branch information
Julian Blank
committed
Sep 30, 2020
1 parent
330bcb8
commit d25963c
Showing
24 changed files
with
453 additions
and
130 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
recursive-include pymoo *.py *.cpp | ||
recursive-include pymoo *.py *.cpp *.pf | ||
recursive-exclude pymoo *.so *.pyx *.pxd | ||
|
||
include LICENSE Makefile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
from pymoo.algorithms.nsga2 import RankAndCrowdingSurvival | ||
from pymoo.algorithms.so_de import DE | ||
from pymoo.docs import parse_doc_string | ||
from pymoo.model.population import Population | ||
from pymoo.util.display import MultiObjectiveDisplay | ||
from pymoo.util.dominator import get_relation | ||
|
||
|
||
class GDE3(DE): | ||
|
||
def __init__(self, **kwargs): | ||
super().__init__(display=MultiObjectiveDisplay(), **kwargs) | ||
|
||
def _next(self): | ||
|
||
# make a step and create the offsprings | ||
self.off = self._step() | ||
|
||
# evaluate the offsprings | ||
self.evaluator.eval(self.problem, self.off, algorithm=self) | ||
|
||
survivors = [] | ||
|
||
for k in range(self.pop_size): | ||
parent, off = self.pop[k], self.off[k] | ||
|
||
rel = get_relation(parent, off) | ||
|
||
if rel == 0: | ||
survivors.extend([parent, off]) | ||
elif rel == -1: | ||
survivors.append(off) | ||
else: | ||
survivors.append(parent) | ||
|
||
survivors = Population.create(*survivors) | ||
|
||
if len(survivors) > self.pop_size: | ||
survivors = RankAndCrowdingSurvival().do(self.problem, survivors, self.pop_size) | ||
|
||
self.pop = survivors | ||
|
||
|
||
parse_doc_string(GDE3.__init__) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.