gemseo / algos

Hide inherited members

opt_result_multiobj module

Multi-objective optimization result.

class gemseo.algos.opt_result_multiobj.MultiObjectiveOptimizationResult(x_0=None, x_0_as_dict=<factory>, x_opt=None, x_opt_as_dict=<factory>, f_opt=None, objective_name='', 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, constraint_values=None, constraints_grad=None, pareto_front=None, _MultiObjectiveOptimizationResult__PARETO_FRONT='pareto_front')[source]

Bases: OptimizationResult

The result of a multi-objective optimization.

Parameters:
  • x_0 (ndarray | None) –

  • x_0_as_dict (dict[str, ndarray]) –

    By default it is set to <factory>.

  • x_opt (ndarray | None) –

  • x_opt_as_dict (dict[str, ndarray]) –

    By default it is set to <factory>.

  • f_opt (ndarray | None) –

  • objective_name (str) –

    By default it is set to “”.

  • status (int | None) –

  • optimizer_name (str | None) –

  • message (str | None) –

  • n_obj_call (int | None) –

  • n_grad_call (int | None) –

  • n_constr_call (int | None) –

  • is_feasible (bool) –

    By default it is set to False.

  • optimum_index (int | None) –

  • constraint_values (Mapping[str, ndarray] | None) –

  • constraints_grad (Mapping[str, ndarray | None] | None) –

  • pareto_front (ParetoFront | None) –

  • _MultiObjectiveOptimizationResult__PARETO_FRONT (Final[str]) –

    By default it is set to “pareto_front”.

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 in result.constraint_values["y"] while the value associated with the key "constr_grad:y" will be stored in result.constraints_grad["y"].

  • dict_ (Mapping[str, Value]) –

Returns:

An optimization result.

Return type:

OptimizationResult

classmethod from_optimization_problem(problem, **fields_)

Create an optimization result from an optimization problem.

Parameters:
  • problem (OptimizationProblem) – The optimization problem.

  • **fields_ – The fields of the OptimizationResult that cannot be deduced from the optimization problem; e.g. "optimizer_name".

Returns:

The optimization result associated with the optimization problem.

Return type:

OptimizationResult

to_dict()[source]

Convert the optimization result to a dictionary.

The keys are the names of the optimization result fields, except for the constraint values and gradients. The key "constr:y" maps to result.constraint_values["y"] while "constr_grad:y" maps to result.constraints_grad["y"].

Returns:

A dictionary representation of the optimization result.

constraint_values: Mapping[str, ndarray] | None = None

The values of the constraints at the optimum.

constraints_grad: Mapping[str, ndarray | None] | None = None

The values of the gradients of the constraints at the optimum.

f_opt: ndarray | None = None

The value of the objective function at the optimum.

is_feasible: bool = False

Whether the solution is feasible.

message: str | None = None

The message returned by the optimizer.

n_constr_call: int | None = None

The number of calls to the constraints function.

n_grad_call: int | None = None

The number of calls to the gradient function.

n_obj_call: int | None = None

The number of calls to the objective function.

objective_name: str = ''

The name of the objective function.

optimizer_name: str | None = None

The name of the optimizer.

optimum_index: int | None = None

The zero-based position of the optimum in the optimization history.

pareto_front: ParetoFront | None = None

The Pareto front when the solution is feasible.

status: int | None = None

The status of the optimization.

x_0: ndarray | None = None

The initial values of the design variables.

x_0_as_dict: dict[str, ndarray]

The design variable names bound to the initial design values.

x_opt: ndarray | None = None

The optimal values of the design variables, called the optimum.

x_opt_as_dict: dict[str, ndarray]

The design variable names bound to the optimal design values.

Examples using MultiObjectiveOptimizationResult

Multi-objective Binh-Korn example with the mNBI algorithm

Multi-objective Binh-Korn example with the mNBI algorithm

Multi-objective Poloni example with the mNBI algorithm

Multi-objective Poloni example with the mNBI algorithm