HYPE

Example

[1]:
from jmetal.algorithm.multiobjective.hype import HYPE
from jmetal.core.solution import FloatSolution
from jmetal.operator.crossover import SBXCrossover
from jmetal.operator.mutation import PolynomialMutation
from jmetal.problem import ZDT1
from jmetal.util.termination_criterion import StoppingByEvaluations

problem = ZDT1()

reference_point = FloatSolution([0], [1], problem.number_of_objectives, )
reference_point.objectives = [1., 1.]  # Mandatory for HYPE

algorithm = HYPE(
    problem=problem,
    reference_point=reference_point,
    population_size=100,
    offspring_population_size=100,
    mutation=PolynomialMutation(probability=1.0 / problem.number_of_variables, distribution_index=20),
    crossover=SBXCrossover(probability=1.0, distribution_index=20),
    termination_criterion=StoppingByEvaluations(2500)
)

algorithm.run()
solutions = algorithm.get_result()
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Cell In[1], line 10
      6 from jmetal.util.termination_criterion import StoppingByEvaluations
      8 problem = ZDT1()
---> 10 reference_point = FloatSolution([0], [1], problem.number_of_objectives, )
     11 reference_point.objectives = [1., 1.]  # Mandatory for HYPE
     13 algorithm = HYPE(
     14     problem=problem,
     15     reference_point=reference_point,
   (...)
     20     termination_criterion=StoppingByEvaluations(2500)
     21 )

File ~/anaconda3/envs/jmetalpy/lib/python3.9/site-packages/jmetal/core/solution.py:76, in FloatSolution.__init__(self, lower_bound, upper_bound, number_of_objectives, number_of_constraints)
     69 def __init__(
     70         self,
     71         lower_bound: List[float],
   (...)
     74         number_of_constraints: int = 0
     75 ):
---> 76     super(FloatSolution, self).__init__(len(lower_bound), number_of_objectives, number_of_constraints)
     77     self.lower_bound = lower_bound
     78     self.upper_bound = upper_bound

File ~/anaconda3/envs/jmetalpy/lib/python3.9/site-packages/jmetal/core/solution.py:15, in Solution.__init__(self, number_of_variables, number_of_objectives, number_of_constraints)
     13 def __init__(self, number_of_variables: int, number_of_objectives: int, number_of_constraints: int = 0):
     14     self.variables = [[] for _ in range(number_of_variables)]
---> 15     self.objectives = [0.0 for _ in range(number_of_objectives)]
     16     self.constraints = [0.0 for _ in range(number_of_constraints)]
     17     self.attributes = {}

TypeError: 'method' object cannot be interpreted as an integer

We can now visualize the Pareto front approximation:

[ ]:
from jmetal.lab.visualization.plotting import Plot
from jmetal.util.solution import get_non_dominated_solutions

front = get_non_dominated_solutions(solutions)

plot_front = Plot(plot_title='Pareto front approximation', axis_labels=['x', 'y'])
plot_front.plot(front, label='HYPE-ZDT1')

API

class jmetal.algorithm.multiobjective.hype.HYPE(problem: ~jmetal.core.problem.Problem, reference_point: ~jmetal.core.solution.Solution, population_size: int, offspring_population_size: int, mutation: ~jmetal.core.operator.Mutation, crossover: ~jmetal.core.operator.Crossover, termination_criterion: ~jmetal.util.termination_criterion.TerminationCriterion = <jmetal.util.termination_criterion.StoppingByEvaluations object>, population_generator: ~jmetal.util.generator.Generator = <jmetal.util.generator.RandomGenerator object>, population_evaluator: ~jmetal.util.evaluator.Evaluator = <jmetal.util.evaluator.SequentialEvaluator object>, dominance_comparator: ~jmetal.util.comparator.Comparator = <jmetal.util.comparator.DominanceComparator object>)[source]

Bases: GeneticAlgorithm[S, R]

evaluate(population: List[S])[source]

Evaluates a solution list.

get_name() str[source]
replacement(population: List[S], offspring_population: List[S]) List[List[S]][source]

Replace least-fit population with new individuals.

result() R[source]