iwopy.interfaces.pymoo.optimizer.Optimizer_pymoo
- class iwopy.interfaces.pymoo.optimizer.Optimizer_pymoo[source]
Bases:
Optimizer
Interface to the pymoo optimization solver.
- Parameters:
- pymoo_problem
The pygmo problem
- Type:
iwopy.interfaces.pymoo.SingleObjProblem
- algo
The pygmo algorithm
- Type:
pygmo.algo
Methods
__init__
(problem, problem_pars, algo_pars[, ...])finalize
(opt_results[, verbosity])This function may be called after finishing the optimization.
get_figure_f
([fig, ax, valid_dict])Create a figure that shows the objective function development during optimization.
initialize
([verbosity])Initialize the object.
Print solver info, called before solving
solve
([callback, verbosity])Run the optimization solver.
Attributes
Flag for finished initialization
- finalize(opt_results, verbosity=1)
This function may be called after finishing the optimization.
- Parameters:
opt_results (iwopy.OptResults) – The optimization results object
verbosity (int) – The verbosity level, 0 = silent
- get_figure_f(fig=None, ax=None, valid_dict=None, **kwargs)[source]
Create a figure that shows the objective function development during optimization.
The kwargs are forwarded to the plot command.
- Parameters:
fig (plt.Figure, optional) – The figure to which to add the plot
ax (plt.Axis, optional) – The axis to which to add the plot
valid_dict (dict, optional) – Settings for the point of first valid solution, forwarded to scatter
- Returns:
fig – The figure
- Return type:
plt.Figure
- initialize(verbosity=1)[source]
Initialize the object.
- Parameters:
verbosity (int) – The verbosity level, 0 = silent
- property initialized
Flag for finished initialization
- Returns:
True if initialization has been done
- Return type:
- solve(callback='default', verbosity=1)[source]
Run the optimization solver.
- Parameters:
callback (pymoo.Callback, optional) – The callback
verbosity (int) – The verbosity level, 0 = silent
- Returns:
results – The optimization results object
- Return type:
iwopy.SingleObjOptResults or iwopy.MultiObjOptResults