doe_scenario module¶
A scenario whose driver is a design of experiments.
- class gemseo.core.doe_scenario.DOEScenario(disciplines, formulation, objective_name, design_space, name=None, grammar_type=GrammarType.JSON, maximize_objective=False, **formulation_options)[source]
Bases:
Scenario
A multidisciplinary scenario to be executed by a design of experiments (DOE).
A
DOEScenario
is a particularScenario
whose driver is a DOE. This DOE must be implemented in aDOELibrary
.Initialize self. See help(type(self)) for accurate signature.
- Parameters:
disciplines (Sequence[MDODiscipline]) – The disciplines used to compute the objective, constraints and observables from the design variables.
formulation (str) – The class name of the
MDOFormulation
, e.g."MDF"
,"IDF"
or"BiLevel"
.objective_name (str | Sequence[str]) – The name(s) of the discipline output(s) used as objective. If multiple names are passed, the objective will be a vector.
design_space (DesignSpace) – The search space including at least the design variables (some formulations requires additional variables, e.g.
IDF
with the coupling variables).name (str | None) – The name to be given to this scenario. If
None
, use the name of the class.grammar_type (MDODiscipline.GrammarType) –
The type of the input and output grammars.
By default it is set to “JSONGrammar”.
maximize_objective (bool) –
Whether to maximize the objective.
By default it is set to False.
**formulation_options (Any) – The options of the
MDOFormulation
.
- to_dataset(name=None, categorize=True, opt_naming=True, export_gradients=False)[source]
Export the database of the optimization problem to a
Dataset
.The variables can be classified into groups:
Dataset.DESIGN_GROUP
orDataset.INPUT_GROUP
for the design variables andDataset.FUNCTION_GROUP
orDataset.OUTPUT_GROUP
for the functions (objective, constraints and observables).- Parameters:
name (str | None) – The name to be given to the dataset. If empty, use the name of the
OptimizationProblem.database
.categorize (bool) –
Whether to distinguish between the different groups of variables. Otherwise, group all the variables in
Dataset.PARAMETER_GROUP`
.By default it is set to True.
opt_naming (bool) –
Whether to use
Dataset.DESIGN_GROUP
andDataset.FUNCTION_GROUP
as groups. Otherwise, useDataset.INPUT_GROUP
andDataset.OUTPUT_GROUP
.By default it is set to True.
export_gradients (bool) –
Whether to export the gradients of the functions (objective function, constraints and observables) if the latter are available in the database of the optimization problem.
By default it is set to False.
- Returns:
A dataset built from the database of the optimization problem.
- Return type:
- EVAL_JAC = 'eval_jac'
- N_SAMPLES = 'n_samples'
- cache: AbstractCache | None
The cache containing one or several executions of the discipline according to the cache policy.
- data_processor: DataProcessor
A tool to pre- and post-process discipline data.
- exec_for_lin: bool
Whether the last execution was due to a linearization.
- formulation: MDOFormulation
The MDO formulation.
- formulation_name: str
The name of the MDO formulation.
- input_grammar: BaseGrammar
The input grammar.
- jac: dict[str, dict[str, ndarray]]
The Jacobians of the outputs wrt inputs.
The structure is
{output: {input: matrix}}
.
- name: str
The name of the discipline.
- optimization_result: OptimizationResult
The optimization result.
- output_grammar: BaseGrammar
The output grammar.
- re_exec_policy: ReExecutionPolicy
The policy to re-execute the same discipline.
- residual_variables: Mapping[str, str]
The output variables mapping to their inputs, to be considered as residuals; they shall be equal to zero.
- run_solves_residuals: bool
Whether the run method shall solve the residuals.
Examples using DOEScenario¶

Simple disciplinary DOE example on the Sobieski SSBJ test case

Pareto front on Binh and Korn problem using a BiLevel formulation