gemseo / post

Hide inherited members

pareto_front module

A Pareto Front.

class gemseo.post.pareto_front.ParetoFront(opt_problem)[source]

Bases: OptPostProcessor

Compute the Pareto front for a multi-objective problem.

The Pareto front of an optimization problem is the set of non-dominated points of the design space for which there is no other point that improves an objective without damaging another.

This post-processing computes the Pareto front and generates a matrix of plots, one per couple of objectives. For a given plot, the red markers are the non-dominated points according to the objectives of this plot and the green markers are the non-dominated points according to all the objectives. The latter are also called Pareto optimal points.

Parameters:

opt_problem (OptimizationProblem) – The optimization problem to be post-processed.

Raises:

ValueError – If the JSON grammar file for the options of the post-processor does not exist.

check_options(**options)

Check the options of the post-processor.

Parameters:

**options (int | float | str | bool | Sequence[str] | tuple[float, float]) – The options of the post-processor.

Raises:

InvalidDataError – If an option is invalid according to the grammar.

Return type:

None

execute(save=True, show=False, file_path='', directory_path='', file_name='', file_extension='', fig_size=(), **options)

Post-process the optimization problem.

Parameters:
  • save (bool) –

    If True, save the figure.

    By default it is set to True.

  • show (bool) –

    If True, display the figure.

    By default it is set to False.

  • file_path (str | Path) –

    The path of the file to save the figures. If the extension is missing, use file_extension. If empty, create a file path from directory_path, file_name and file_extension.

    By default it is set to “”.

  • directory_path (str | Path) –

    The path of the directory to save the figures. If empty, use the current working directory.

    By default it is set to “”.

  • file_name (str) –

    The name of the file to save the figures. If empty, use a default one generated by the post-processing.

    By default it is set to “”.

  • file_extension (str) –

    A file extension, e.g. ‘png’, ‘pdf’, ‘svg’, … If empty, use a default file extension.

    By default it is set to “”.

  • fig_size (FigSizeType) –

    The width and height of the figure in inches, e.g. (w, h). If empty, use the OptPostProcessor.DEFAULT_FIG_SIZE of the post-processor.

    By default it is set to ().

  • **options (OptPostProcessorOptionType) – The options of the post-processor.

Returns:

The figures, to be customized if not closed.

Raises:

ValueError – If the opt_problem.database is empty.

DEFAULT_FIG_SIZE = (10.0, 10.0)

The default width and height of the figure, in inches.

database: Database

The database generated by the optimization problem.

property figures: dict[str, Figure]

The Matplotlib figures indexed by a name, or the nameless figure counter.

materials_for_plotting: dict[Any, Any]

The materials to eventually rebuild the plot in another framework.

opt_problem: OptimizationProblem

The optimization problem.

property output_files: list[str]

The paths to the output files.