code: def test_nsga3(self):
      NDIM = 5
      BOUND_LOW, BOUND_UP = 0.0, 1.0
      MU = 16
      NGEN = 100
  
      ref_points = tools.uniform_reference_points(2, p=12)
  
      toolbox = base.Toolbox()
      toolbox.register(
          "attr_float", random.uniform, BOUND_LOW, BOUND_UP
      )
      toolbox.register(
          "individual",
          tools.initRepeat,
          creator.__dict__[INDCLSNAME],
          toolbox.attr_float,
          NDIM,
      )
      toolbox.register(
          "population", tools.initRepeat, list, toolbox.individual
      )
  
      toolbox.register("evaluate", benchmarks.zdt1)
      toolbox.register(
          "mate",
          tools.cxSimulatedBinaryBounded,
          low=BOUND_LOW,
          up=BOUND_UP,
          eta=20.0,
      )
      toolbox.register(
          "mutate",
          tools.mutPolynomialBounded,
          low=BOUND_LOW,
          up=BOUND_UP,
          eta=20.0,
          indpb=1.0 / NDIM,
      )
      toolbox.register("select", tools.selNSGA3, ref_points=ref_points)
  
      pop = toolbox.population(n=MU)
      fitnesses = toolbox.map(toolbox.evaluate, pop)
      for ind, fit in zip(pop, fitnesses):
          ind.fitness.values = fit
  
      pop = toolbox.select(pop, len(pop))
      # Begin the generational process
      for gen in range(1, NGEN):
          # Vary the individuals
          offspring = list(
              islice(
                  algorithms.varAnd(pop, toolbox, 1.0, 1.0), len(pop)
              )
          )
  
          # Evaluate the individuals with an invalid fitness
          invalid_ind = [
              ind for ind in offspring if not ind.fitness.valid
          ]
          fitnesses = toolbox.map(toolbox.evaluate, invalid_ind)
          for ind, fit in zip(invalid_ind, fitnesses):
              ind.fitness.values = fit
  
          # Select the next generation population
          pop = toolbox.select(pop + offspring, MU)
  
      hv = hypervolume(pop, [11.0, 11.0])
      # hv = 120.777 # Optimal value
  
      self.assertGreater(hv, HV_THRESHOLD)
  
      for ind in pop:
          self.assertTrue(all(numpy.asarray(ind) >= BOUND_LOW))
          self.assertTrue(all(numpy.asarray(ind) <= BOUND_UP))
  
imports: from itertools import islice
  import random
  import unittest
  from deap import algorithms
  from deap import base
  from deap import benchmarks
  from deap.benchmarks.tools import hypervolume
  from deap import cma
  from deap import creator
  from deap import tools
label_desc: Use image node_id 3 for calling the TestMultiObjective obj's underlying member method code with example usage: obj.test_nsga3() without return types