process module¶
Scalability study - Process.
The ScalabilityStudy
class implements
the concept of scalability study:
By instantiating a
ScalabilityStudy
, the user defines the MDO problem in terms of design parameters, objective function and constraints.For each discipline, the user adds a dataset stored in a
Dataset
and select a type ofScalableModel
to build theScalableDiscipline
associated with this discipline.The user adds different optimization strategies, defined in terms of both optimization algorithms and MDO formulation.
The user adds different scaling strategies, in terms of sizes of design parameters, coupling variables and equality and inequality constraints. The user can also define a scaling strategies according to particular parameters rather than groups of parameters.
Lastly, the user executes the
ScalabilityStudy
and the results are written in several files and stored into directories in a hierarchical way, where names depend on both MDO formulation, scaling strategy and replications when it is necessary. Different kinds of files are stored: optimization graphs, dependency matrix plots and of course, scalability results by means of a dedicated class:ScalabilityResult
.
- class gemseo.problems.scalable.data_driven.study.process.ScalabilityStudy(objective, design_variables, directory='study', prefix='', eq_constraints=None, ineq_constraints=None, maximize_objective=False, fill_factor=0.7, active_probability=0.1, feasibility_level=0.8, start_at_equilibrium=True, early_stopping=True, coupling_variables=None)[source]
Bases:
object
Scalability Study.
The constructor of the ScalabilityStudy class requires two mandatory arguments:
the
'objective'
name,the list of
'design_variables'
names.
Concerning output files, we can specify:
the
directory
which is'study'
by default,the prefix of output file names (default: no prefix).
Regarding optimization parametrization, we can specify:
the list of equality constraints names (
eq_constraints
),the list of inequality constraints names (
ineq_constraints
),the choice of maximizing the objective function (
maximize_objective
).
By default, the objective function is minimized and the MDO problem is unconstrained.
Last but not least, with regard to the scalability methodology, we can overwrite:
the default fill factor of the input-output dependency matrix
ineq_constraints
,the probability to set the inequality constraints as active at initial step of the optimization
active_probability
,the offset of satisfaction for inequality constraints
feasibility_level
,the use of a preliminary MDA to start at equilibrium
start_at_equilibrium
,the post-processing of the optimization database to get results earlier than final step
early_stopping
.
Args: :param str objective: name of the objective :param list(str) design_variables: names of the design variables :param str directory: working directory of the study. Default: ‘study’. :param str prefix: prefix for the output filenames. Default: ‘’. :param list(str) eq_constraints: names of the equality constraints.
Default: None.
- Parameters:
ineq_constraints (list(str)) – names of the inequality constraints Default: None.
maximize_objective (bool) –
maximizing objective. Default: False.
By default it is set to False.
fill_factor (float) –
default fill factor of the input-output dependency matrix. Default: 0.7.
By default it is set to 0.7.
active_probability (float) –
probability to set the inequality constraints as active at initial step of the optimization. Default: 0.1
By default it is set to 0.1.
feasibility_level (float) –
offset of satisfaction for inequality constraints. Default: 0.8.
By default it is set to 0.8.
start_at_equilibrium (bool) –
start at equilibrium using a preliminary MDA. Default: True.
By default it is set to True.
early_stopping (bool) –
post-process the optimization database to get results earlier than final step.
By default it is set to True.
directory (str) –
By default it is set to “study”.
prefix (str) –
By default it is set to “”.
- add_discipline(data)[source]
This method adds a disciplinary dataset from a dataset.
- Parameters:
data (Dataset) – dataset provided as a dataset.
- Return type:
None
- add_optimization_strategy(algo, max_iter, formulation='DisciplinaryOpt', algo_options=None, formulation_options=None, top_level_diff='auto')[source]
Add both optimization algorithm and MDO formulation, as well as their options.
- Parameters:
algo (str) – name of the optimization algorithm.
max_iter (int) – maximum number of iterations for the optimization algorithm.
formulation (str) –
name of the MDO formulation. Default: ‘DisciplinaryOpt’.
By default it is set to “DisciplinaryOpt”.
algo_options (dict) – options of the optimization algorithm.
formulation_options (dict) – options of the MDO formulation.
top_level_diff (str) –
differentiation method for the top level disciplines. Default: ‘auto’.
By default it is set to “auto”.
- Return type:
None
- add_scaling_strategies(design_size=None, coupling_size=None, eq_cstr_size=None, ineq_cstr_size=None, variables=None)[source]
Add different scaling strategies.
- Parameters:
design_size (int or list(int)) – size of the design variables. Default: None.
coupling_size (int or list(int)) – size of the coupling variables. Default: None.
eq_cstr_size (int or list(int)) – size of the equality constraints. Default: None.
ineq_cstr_size (int or list(int)) – size of the inequality constraints. Default: None.
variables (list[None] | None) –
- Return type:
None
- execute(n_replicates=1)[source]
Execute the scalability study, one or several times to take into account the random features of the scalable problems.
- Parameters:
n_replicates (int) –
number of times the scalability study is repeated.
By default it is set to 1.
- set_fill_factor(discipline, output, fill_factor)[source]
- set_input_output_dependency(discipline, output, inputs)[source]
Set the dependency between an output and a set of inputs for a given discipline.