Skip to content

Commit cabfa6d

Browse files
committed
Support of NSGA-II
1 parent a3dc00b commit cabfa6d

File tree

8 files changed

+290
-270
lines changed

8 files changed

+290
-270
lines changed

pygad/helper/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
from pygad.helper import unique, nsga2
1+
from pygad.helper import unique
22

3-
__version__ = "1.2.0"
3+
__version__ = "1.1.0"

pygad/helper/nsga2.py

Lines changed: 0 additions & 252 deletions
This file was deleted.

pygad/pygad.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@
1111
from pygad import visualize
1212
import sys
1313

14+
# Extend all the classes so that they can be referenced by just the `self` object of the `pygad.GA` class.
1415
class GA(utils.parent_selection.ParentSelection,
1516
utils.crossover.Crossover,
1617
utils.mutation.Mutation,
18+
utils.nsga2.NSGA2,
1719
helper.unique.Unique,
1820
visualize.plot.Plot):
1921

pygad/utils/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from pygad.utils import parent_selection
22
from pygad.utils import crossover
33
from pygad.utils import mutation
4+
from pygad.utils import nsga2
45

5-
__version__ = "1.0.1"
6+
__version__ = "1.1.0"

pygad/utils/crossover.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
import random
77

88
class Crossover:
9+
10+
def __init__():
11+
pass
12+
913
def single_point_crossover(self, parents, offspring_size):
1014

1115
"""

pygad/utils/mutation.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99

1010
class Mutation:
1111

12+
def __init__():
13+
pass
14+
1215
def random_mutation(self, offspring):
1316

1417
"""

0 commit comments

Comments
 (0)