gemseo.scenarios.doe_scenario module#
A multidisciplinary scenario to be executed by a design of experiments (DOE).
- class DOEScenario(disciplines, objective_name, design_space, name='', maximize_objective=False, formulation_settings_model=None, **formulation_settings)[source]#
Bases:
BaseScenario
A multidisciplinary scenario to be executed by a design of experiments (DOE).
Initialize self. See help(type(self)) for accurate signature.
- Parameters:
disciplines (Sequence[Discipline]) -- The disciplines used to compute the objective, constraints and observables from the design variables.
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) --
The name to be given to this scenario. If empty, use the name of the class.
By default it is set to "".
maximize_objective (bool) --
Whether to maximize the objective.
By default it is set to False.
formulation_settings_model (BaseFormulationSettings | None) -- The formulation settings as a Pydantic model. If
None
, use**settings
.**formulation_settings (Any) -- The formulation settings, including the formulation name (use the keyword
"formulation_name"
). These arguments are ignored whensettings_model
is notNone
.
- Settings Settings(*, algo_name, algo_settings=None)#
Bases:
_BaseSettings
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- algo_name: cls._algo_enum [Required]#
The name of the algorithm.
- to_dataset(name='', 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) --
The name to be given to the dataset. If empty, use the name of the
OptimizationProblem.database
.By default it is set to "".
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: