Skip to content

Commit

Permalink
Support of NSGA-II
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmedfgad committed Sep 6, 2023
1 parent 613efcb commit 3f71ec0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 24 deletions.
4 changes: 2 additions & 2 deletions pygad/utils/nsga2.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def get_non_dominated_set(self, curr_solutions):

def non_dominated_sorting(self, fitness):
"""
Apply the non-dominant sorting over the fitness to create the pareto fronts based on non-dominaned sorting of the solutions.
Apply non-dominant sorting over the fitness to create the pareto fronts based on non-dominaned sorting of the solutions.
Parameters
----------
Expand Down Expand Up @@ -114,7 +114,7 @@ def non_dominated_sorting(self, fitness):

def crowding_distance(self, pareto_front, fitness):
"""
Calculate the crowding dstance for all solutions in the current pareto front.
Calculate the crowding distance for all solutions in the current pareto front.
Parameters
----------
Expand Down
25 changes: 3 additions & 22 deletions pygad/visualize/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,13 @@
"""

import numpy
import warnings
import matplotlib.pyplot
import pygad

class Plot:
def plot_result(self,
title="PyGAD - Generation vs. Fitness",
xlabel="Generation",
ylabel="Fitness",
linewidth=3,
font_size=14,
plot_type="plot",
color="#64f20c",
save_dir=None):

if not self.suppress_warnings:
warnings.warn("Please use the plot_fitness() method instead of plot_result(). The plot_result() method will be removed in the future.")

return self.plot_fitness(title=title,
xlabel=xlabel,
ylabel=ylabel,
linewidth=linewidth,
font_size=font_size,
plot_type=plot_type,
color=color,
save_dir=save_dir)

def __init__():
pass

def plot_fitness(self,
title="PyGAD - Generation vs. Fitness",
Expand Down

0 comments on commit 3f71ec0

Please sign in to comment.