iwopy.interfaces.pygmo.optimizer¶
Classes¶
Interface to the pygmo optimizers |
Module Contents¶
-
class iwopy.interfaces.pygmo.optimizer.Optimizer_pygmo(problem: iwopy.core.Problem, optimizer: str =
'de', *, pop_size: int =1, seed: int | None =None, vectorize: bool =False, max_iterations: int | None =None, max_evaluations: int | None =None, norandom_first: bool | None =None, c_tol: float =0.0001, problem_verbosity: int =0, algorithm_verbosity: int =1, nlopt_optimizer: str | None =None, name: str ='Optimizer_pygmo', **kwargs: Any)[source]¶ Bases:
iwopy.core.OptimizerInterface to the pygmo optimizers for serial runs.
- Parameters:¶
- problem: iwopy.core.Problem¶
The problem to optimize
- optimizer: str =
'de'¶ Native driver name, such as de, ipopt, or nlopt.
- pop_size: int =
1¶ Absolute population size. Local solvers operate on one selected member.
- seed: int | None =
None¶ Seed for both the population and native drivers supporting seed.
- vectorize: bool =
False¶ Enable batch fitness where supported by the selected driver.
- max_iterations: int | None =
None¶ IPOPT iteration or evolutionary-driver generation limit. Unsupported for NLopt and compass_search. None preserves the native default.
- max_evaluations: int | None =
None¶ Native driver fitness-call limit for NLopt or compass_search, excluding initial population construction. Unsupported for other drivers. None preserves the native default.
- norandom_first: bool | None =
None¶ Replace the first individual with problem initial values; None enables this when pop_size is one.
- c_tol: float =
0.0001¶ Native population constraint tolerance.
- problem_verbosity: int =
0¶ UDP diagnostics and native algorithm verbosity levels.
- algorithm_verbosity: int =
1¶ UDP diagnostics and native algorithm verbosity levels.
- nlopt_optimizer: str | None =
None¶ Native NLopt solver name when optimizer is nlopt. The standalone factory supplies it automatically for family nlopt.
- name: str =
'Optimizer_pygmo'¶ Optimizer name.
- **kwargs: Any¶
Flat native driver options, such as print_level and ftol_rel.
- Raises:¶
ValueError – If limits are invalid or unsupported by the selected driver, vectorize is not a boolean, or driver selection is inconsistent.
TypeError – If a superseded or unsupported shared keyword is supplied.
-
finalize(opt_results: iwopy.core.opt_results.SingleObjOptResults | iwopy.core.opt_results.MultiObjOptResults | int | None =
None, verbosity: int =1) None¶ This function may be called after finishing the optimization.
- Parameters:¶
- opt_results: iwopy.core.opt_results.SingleObjOptResults | iwopy.core.opt_results.MultiObjOptResults | int | None =
None¶ The optimization results object
- verbosity: int =
1¶ The verbosity level, 0 = silent
- opt_results: iwopy.core.opt_results.SingleObjOptResults | iwopy.core.opt_results.MultiObjOptResults | int | None =
-
solve(verbosity: int =
1, callbacks: list[iwopy.core.OptimizerCallback] | None =None) iwopy.core.SingleObjOptResults[source]¶ Run the optimization solver.
-
c_tol =
0.0001¶
- property initialized : bool¶
Flag for finished initialization
- Returns:¶
initialized – True if initialization has been done
-
name =
'optimizer'¶
- norandom_first¶
-
optimizer =
'de'¶
-
pop_size =
1¶
- problem¶
-
problem_verbosity =
0¶
-
seed =
None¶
-
udp : iwopy.interfaces.pygmo.problem.UDP | None =
None¶
-
vectorize =
False¶
-
verbosity =
1¶