opt_result_mo module¶
Multi-objective optimization result.
- class gemseo_pymoo.algos.opt_result_mo.MultiObjectiveOptimizationResult(x_0=None, x_opt=None, f_opt=None, status=None, optimizer_name=None, message=None, n_obj_call=None, n_grad_call=None, n_constr_call=None, is_feasible=False, optimum_index=None, constraints_values=None, constraints_grad=None, pareto=None)[source]¶
Bases:
gemseo.algos.opt_result.OptimizationResult
The result of a multi-objective optimization.
- Parameters
x_0 (ndarray | None) –
By default it is set to None.
x_opt (ndarray | None) –
By default it is set to None.
f_opt (ndarray | None) –
By default it is set to None.
status (int | None) –
By default it is set to None.
optimizer_name (str | None) –
By default it is set to None.
message (str | None) –
By default it is set to None.
n_obj_call (int | None) –
By default it is set to None.
n_grad_call (int | None) –
By default it is set to None.
n_constr_call (int | None) –
By default it is set to None.
is_feasible (bool) –
By default it is set to False.
optimum_index (int | None) –
By default it is set to None.
constraints_values (Mapping[str, ndarray] | None) –
By default it is set to None.
constraints_grad (Mapping[str, ndarray] | None) –
By default it is set to None.
pareto (Pareto | None) –
By default it is set to None.
- Return type
None
- classmethod from_dict(dict_)¶
Create an optimization result from a dictionary.
- Parameters
dict – The dictionary representation of the optimization result. The keys are the names of the optimization result fields, except for the constraint values and gradients. The value associated with the key
"constr:y"
will be stored inresult.constraints_values["y"]
while the value associated with the key"constr_grad:y"
will be stored inresult.constraints_grad["y"]
.dict_ (Mapping[str, Union[str, int, bool, numpy.ndarray]]) –
- Returns
An optimization result.
- Return type
- get_data_dict_repr()¶
Convert the multi-objective optimization result to a dictionary.
The keys are the names of the optimization result fields, except for the constraint values, gradients and the
pareto
. The key"constr:y"
maps toresult.constraints_values["y"]
,"constr_grad:y"
maps toresult.constraints_grad["y"]
and"pareto:y"
maps toresult.pareto.y
.
- to_dict()[source]¶
Convert the multi-objective optimization result to a dictionary.
The keys are the names of the optimization result fields, except for the constraint values, gradients and the
pareto
. The key"constr:y"
maps toresult.constraints_values["y"]
,"constr_grad:y"
maps toresult.constraints_grad["y"]
and"pareto:y"
maps toresult.pareto.y
.
- constraints_grad: Mapping[str, ndarray] | None = None¶
The values of the gradients of the constraints at the optimum.
- constraints_values: Mapping[str, ndarray] | None = None¶
The values of the constraints at the optimum.
- class gemseo_pymoo.algos.opt_result_mo.Pareto(problem)[source]¶
Bases:
object
Hold data from multi-objective optimization problems.
Initialize an object containing pareto related data.
- Parameters
problem (gemseo.algos.opt_problem.OptimizationProblem) – The optimization problem.
- Return type
None
- static get_lowest_norm(pareto_front, pareto_set, reference=None, order=2)[source]¶
Get Pareto points with the lowest norm relative to a reference point.
- Parameters
pareto_front (ndarray) – The objectives’ value of all non-dominated points.
pareto_set (ndarray) – The design variables’ value of all non-dominated points.
reference (ndarray | None) –
The reference point. If None, the origin (0, 0, …, 0) will be used.
By default it is set to None.
order (int) –
The order of the norm.
By default it is set to 2.
- Returns
The objectives’ values of the point(s) with the lowest norm. The design variables’ values of the point(s) with the lowest norm. The lowest norm value.
- Raises
ValueError – If the reference point does not have the appropriate dimension.
- Return type
- static get_pareto(gemseo_problem)[source]¶
Get Pareto Front and Pareto Set from the database.
- Parameters
gemseo_problem (OptimizationProblem) – The optimization problem containing the results from an optimization run.
- Returns
The objectives’ value of all non-dominated points and the design variables’ value of all non-dominated points.
None if a single-objective
OptimizationProblem
is provided.- Raises
RuntimeError – If the optimization problem is single-objective.
- Return type
- static get_pareto_anchor(pareto_front, pareto_set)[source]¶
Get Pareto’s anchor points.
- Parameters
pareto_front (numpy.ndarray) – The objectives’ value of all non-dominated points.
pareto_set (numpy.ndarray) – The design variables’ value of all non-dominated points.
- Returns
The objectives’ values of all anchor points. The design variables’ values of all anchor points.
- Return type
- static get_pretty_table_from_df(df)[source]¶
Build a tabular view of the Pareto problem.
- Parameters
df (pandas.core.frame.DataFrame) – The Pareto data.
- Returns
- A
PrettyTable
representing the dataframe.
- A
- Return type
- property anchor_front: numpy.ndarray¶
The values of the objectives of all anchor points.
At those points, each objective is minimized one at a time.
- property anchor_set: numpy.ndarray¶
The values of the design variables values of all anchor points.
At those points, each objective is minimized one at a time.
- property anti_utopia: numpy.ndarray¶
The point where every objective reaches its maximum simultaneously.
- property front: numpy.ndarray¶
The values of the objectives of all pareto efficient solutions.
- property min_norm_f: numpy.ndarray¶
The objectives value of the closest point(s) to the
utopia
.
- property min_norm_x: numpy.ndarray¶
The design variables value of the closest point(s) to the
utopia
.
- property problem: gemseo.algos.opt_problem.OptimizationProblem¶
The optimization problem whose Pareto data is represented.
- property set: numpy.ndarray¶
The values of the design variables of all pareto efficient solutions.
- property utopia: numpy.ndarray¶
The ideal point where every objective reaches its minimum simultaneously.