Hi, I am trying to run an experiment using NSGAII and randomSearch. However my script breaks when it reaches the class RandomSearch with the folloiwng error.
2018-08-30 03:22:29,075 [MainThread ] [INFO ] Running experiment: problem <miniaturization.Miniaturization object at 0x7f95bf2c7518>, algorithm <module 'jmetal.algorithm.multiobjective.randomSearch' from '/usr/local/lib/python3.6/site-packages/jmetalpy-0.5.0-py3.6.egg/jmetal/algorithm/multiobjective/randomSearch.py'>
Traceback (most recent call last):
File "NSGAII-RS for MINIOT.py", line 17, in <module>
results = experiment(algorithm, metric, problem)
File "/usr/local/lib/python3.6/site-packages/jmetalpy-0.5.0-py3.6.egg/jmetal/util/laboratory.py", line 41, in experiment
pool.submit(algorithm_list[a_index][0].run())
AttributeError: module 'jmetal.algorithm.multiobjective.randomSearch' has no attribute 'run'
This the code of my experiment:
from jmetal.algorithm import NSGAII
from jmetal.algorithm.multiobjective import randomSearch
from jmetal.component.comparator import RankingAndCrowdingDistanceComparator
from jmetal.operator import SP, BitFlip, BinaryTournamentSelection
from miniaturization import Miniaturization
from jmetal.component.quality_indicator import HyperVolume
from jmetal.util.laboratory import experiment, display
algorithm = [
( (randomSearch, {'max_evaluations': 250}))
]
metric = [HyperVolume(reference_point=[1, 1, 1, 1])]
problem = [(Miniaturization, {})]
results = experiment(algorithm, metric, problem)
display(results)
Do you have any idea why this happening? NSGAII is working well.
Hi, I am trying to run an experiment using NSGAII and randomSearch. However my script breaks when it reaches the class RandomSearch with the folloiwng error.
This the code of my experiment:
Do you have any idea why this happening? NSGAII is working well.