Note
Go to the end to download the full example code.
DOE algorithms#
In this example, we will discover the different functions of the API related to design of experiments.
from __future__ import annotations
from gemseo import configure_logger
from gemseo import get_algorithm_options_schema
from gemseo import get_available_doe_algorithms
configure_logger()
<RootLogger root (INFO)>
Get available DOE algorithms#
The get_available_doe_algorithms()
function returns the list
of optimization algorithms available in GEMSEO or in external modules
get_available_doe_algorithms()
['CustomDOE', 'DiagonalDOE', 'MorrisDOE', 'OATDOE', 'OT_SOBOL', 'OT_RANDOM', 'OT_HASELGROVE', 'OT_REVERSE_HALTON', 'OT_HALTON', 'OT_FAURE', 'OT_MONTE_CARLO', 'OT_FACTORIAL', 'OT_COMPOSITE', 'OT_AXIAL', 'OT_OPT_LHS', 'OT_LHS', 'OT_LHSC', 'OT_FULLFACT', 'OT_SOBOL_INDICES', 'PYDOE_BBDESIGN', 'PYDOE_CCDESIGN', 'PYDOE_FF2N', 'PYDOE_FULLFACT', 'PYDOE_LHS', 'PYDOE_OBDESIGN', 'Halton', 'LHS', 'MC', 'PoissonDisk', 'Sobol']
Get options schema#
For a given optimization algorithm, e.g. "DiagonalDOE"
,
we can get the options; e.g.
get_algorithm_options_schema("DiagonalDOE")
{'additionalProperties': False, 'description': 'The settings of the diagonal DOE for scalable model construction.', 'properties': {'enable_progress_bar': {'anyOf': [{'type': 'boolean'}, {'type': 'null'}], 'default': None, 'description': 'Whether to enable the progress bar in the optimization log.\n\nIf ``None``, use the global value of ``enable_progress_bar`` (see the\n``configure`` function to change it globally).', 'title': 'Enable Progress Bar'}, 'eq_tolerance': {'default': 0.01, 'description': 'The tolerance on the equality constraints.', 'minimum': 0.0, 'title': 'Eq Tolerance', 'type': 'number'}, 'ineq_tolerance': {'default': 0.0001, 'description': 'The tolerance on the inequality constraints.', 'minimum': 0.0, 'title': 'Ineq Tolerance', 'type': 'number'}, 'log_problem': {'default': True, 'description': 'Whether to log the definition and result of the problem.', 'title': 'Log Problem', 'type': 'boolean'}, 'max_time': {'default': 0.0, 'description': 'The maximum runtime in seconds, disabled if 0.', 'minimum': 0.0, 'title': 'Max Time', 'type': 'number'}, 'normalize_design_space': {'default': False, 'description': 'Whether to normalize the design space variables between 0 and 1.', 'title': 'Normalize Design Space', 'type': 'boolean'}, 'reset_iteration_counters': {'default': True, 'description': 'Whether to reset the iteration counters before each execution.', 'title': 'Reset Iteration Counters', 'type': 'boolean'}, 'round_ints': {'default': True, 'description': 'Whether to round the integer variables.', 'title': 'Round Ints', 'type': 'boolean'}, 'use_database': {'default': True, 'description': 'Whether to wrap the functions in the database.', 'title': 'Use Database', 'type': 'boolean'}, 'use_one_line_progress_bar': {'default': False, 'description': 'Whether to log the progress bar on a single line.', 'title': 'Use One Line Progress Bar', 'type': 'boolean'}, 'store_jacobian': {'default': True, 'description': 'Whether to store the Jacobian matrices in the database.\n\nThis argument is ignored when the ``use_database`` option is ``False``.\nIf a gradient-based algorithm is used,\nthis option cannot be set along with kkt options.', 'title': 'Store Jacobian', 'type': 'boolean'}, 'eval_jac': {'default': False, 'description': 'Whether to evaluate the Jacobian function.', 'title': 'Eval Jac', 'type': 'boolean'}, 'n_processes': {'default': 1, 'description': 'The maximum number of processes to parallelize the execution.', 'exclusiveMinimum': 0, 'title': 'N Processes', 'type': 'integer'}, 'wait_time_between_samples': {'default': 0.0, 'description': 'The time to wait between each sample evaluation, in seconds.', 'minimum': 0.0, 'title': 'Wait Time Between Samples', 'type': 'number'}, 'callbacks': {'default': [], 'description': 'The functions to be evaluated after each functions evaluation.\n\nThe functions evaluation is done by\n:meth:`.OptimizationProblem.evaluate_functions` and the callback must be\ncalled as ``callback(index, (output, Jacobian))``.', 'items': {}, 'title': 'Callbacks', 'type': 'array'}, 'n_samples': {'default': 2, 'description': 'The number of samples.\n\nThe number of samples must be greater than or equal than 2.', 'minimum': 2, 'title': 'N Samples', 'type': 'integer'}, 'reverse': {'description': 'The dimensions or variables to sample from upper to lower bounds.\n\nIf empty, every dimension will be sampled from lower to upper bounds.', 'items': {'type': 'string'}, 'title': 'Reverse', 'type': 'array'}}, 'title': 'DiagonalDOESettings', 'type': 'object'}
Total running time of the script: (0 minutes 0.008 seconds)