gemseo.formulations.bilevel_settings module#

Settings of the BiLevel formulation .

Settings BiLevel_Settings(*, differentiated_input_names_substitute=(), main_mda_name='MDAChain', main_mda_settings=None, parallel_scenarios=False, multithread_scenarios=True, apply_cstr_tosub_scenarios=True, apply_cstr_to_system=True, reset_x0_before_opt=False, sub_scenarios_log_level=None)[source]#

Bases: MDF_Settings

Settings of the BiLevel formulation.

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.

Parameters:
  • differentiated_input_names_substitute (Sequence[str]) --

    By default it is set to ().

  • main_mda_name (str) --

    By default it is set to "MDAChain".

  • main_mda_settings (Mapping[str, Any] | BaseMDASettings)

  • parallel_scenarios (bool) --

    By default it is set to False.

  • multithread_scenarios (bool) --

    By default it is set to True.

  • apply_cstr_tosub_scenarios (bool) --

    By default it is set to True.

  • apply_cstr_to_system (bool) --

    By default it is set to True.

  • reset_x0_before_opt (bool) --

    By default it is set to False.

  • sub_scenarios_log_level (int | None)

Return type:

None

apply_cstr_to_system: bool = True#

Whether the add_constraint() method adds the constraint to the optimization problem of the system scenario.

apply_cstr_tosub_scenarios: bool = True#

Whether the add_constraint() method adds the constraint to the optimization problem of the sub-scenario capable of computing the constraint.

multithread_scenarios: bool = True#

If True and parallel_scenarios=True, the sub-scenarios are run in parallel using multi-threading; if False and parallel_scenarios=True, multiprocessing is used.

parallel_scenarios: bool = False#

Whether to run the sub-scenarios in parallel.

reset_x0_before_opt: bool = False#

Whether to restart the sub optimizations from the initial guesses, otherwise warm start them.

sub_scenarios_log_level: int | None = None#

The level of the root logger during the sub-scenarios executions. If None, do not change the level of the root logger.

model_post_init(context, /)#

We need to both initialize private attributes and call the user-defined model_post_init method.

Parameters:
  • self (BaseModel)

  • context (Any)

Return type:

None