pymoo_problem_adapater module¶
An adapter for pymoo Problem
.
- class gemseo_pymoo.algos.opt.core.pymoo_problem_adapater.PymooProblem(*args, **kwargs)[source]¶
Bases:
pymoo.core.problem.Problem
Interface between GEMSEO and pymoo optimization problems.
It supports multiprocessing.
Initialize a pymoo
Problem
from a GEMSEO one.It also sets up a parallel object
ParallelExecution
for multiprocessing purposes.- Parameters
opt_problem (gemseo.algos.opt_problem.OptimizationProblem) – The GEMSEO problem to convert to a pymoo problem.
normalize_ds (bool) – Whether to normalize the design variables.
driver (gemseo.algos.opt.opt_lib.OptimizationLibrary) – The optimization library used to handle the problem.
**options (Any) – The other algorithm options.
- Return type
None
- max_gen¶
The maximum number of generations allowed.
- normalize_ds¶
Whether the design space is normalized.
- opt_problem¶
The GEMSEO optimization problem.
- gemseo_pymoo.algos.opt.core.pymoo_problem_adapater.get_gemseo_opt_problem(pymoo_pb, **pymoo_pb_options)[source]¶
Create a GEMSEO problem from a pymoo
Problem
.If the pymoo problem’s name is provided, it must be a valid name among the available ones (see pymoo problems).
- Parameters
pymoo_pb (str | Problem) – The pymoo problem to be converted.
**pymoo_pb_options (Any) – The additional arguments to be passed to the pymoo’s problem
getter
get_problem
.
- Returns
An instance of a GEMSEO
OptimizationProblem
.- Raises
TypeError – If
pymoo_pb
is not a valid string nor an instance ofProblem
.- Return type
- gemseo_pymoo.algos.opt.core.pymoo_problem_adapater.import_hdf(file_path, x_tolerance=0.0)[source]¶
Import an optimization history from an HDF file.
It uses
gemseo.algos.opt_problem.OptimizationProblem.import_hdf()
to import the optimization history from the HDF file. Afterwards, it replaces thegemseo.algos.opt_result.OptimizationResult
object ingemseo.algos.opt_problem.OptimizationProblem.solution
by agemseo_pymoo.algos.opt_result_mo.MultiObjectiveOptimizationResult
object.- Parameters
- Returns
The read optimization problem.
- Return type