jMetal / jMetalPy

A framework for single/multi-objective optimization with metaheuristics
https://jmetal.github.io/jMetalPy/index.html
MIT License
497 stars 150 forks source link

Why does hypervolume decreases when number of generations increase for a given population size? #128

Closed mishras9 closed 2 years ago

mishras9 commented 2 years ago

@ajnebro

I have used the following code. Hypervolume increases with increase in number of functional evaluations. However, for a given population size, as the number of generation increases the hypervolume reduces. Which I think should rather increase. Why am I getting such an answer?

import os
import sys  
iter = 1  
maxIter = 3 #How many times you want to do it…
while (iter <= maxIter):
    from jmetal.algorithm.multiobjective.nsgaii import NSGAII
    from jmetal.operator import SBXCrossover, PolynomialMutation
    from jmetal.util.termination_criterion import StoppingByEvaluations

    problem = MyProblem()
    MFES= 10000

    algorithm = NSGAII(
    problem=problem,
    population_size=100,
    offspring_population_size=100,
    mutation=PolynomialMutation(probability=0.3, distribution_index=20),
    crossover=SBXCrossover(probability=0.9, distribution_index=20),
    termination_criterion=StoppingByEvaluations(max_evaluations=MFES)
    )

    algorithm.run()
    solutions = algorithm.get_result()

    iter += 1
print('Loop ended.')