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', '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', 'fullfact', 'ff2n', 'pbdesign', 'bbdesign', 'ccdesign', 'lhs', '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")
{'$schema': 'http://json-schema.org/draft-04/schema', 'additionalProperties': False, 'description': 'Diagonal DOE algorithm', 'type': 'object', 'properties': {'normalize_design_space': {'type': 'boolean'}, 'round_ints': {'type': 'boolean'}, 'use_database': {'type': 'boolean'}, 'reset_iteration_counters': {'type': 'boolean'}, 'eval_jac': {'description': 'Whether to evaluate the Jacobian.', 'type': 'boolean'}, 'n_processes': {'minimum': 1, 'description': 'The maximum simultaneous number of processes\nused to parallelize the execution.', 'type': 'integer'}, 'wait_time_between_samples': {'minimum': 0, 'description': 'The waiting time between two samples.', 'type': 'number'}, 'n_samples': {'minimum': 2, 'description': 'The number of samples.\nThe number of samples must be greater than or equal to 2.', 'type': 'integer'}, 'max_time': {'minimum': 0.0, 'description': 'The maximum runtime in seconds.\nIf 0, no maximum runtime is set.', 'type': 'number'}, 'reverse': {'anyOf': [{'description': 'The dimensions or variables to sample from their upper bounds to\ntheir lower bounds.\nIf ``None``, every dimension will be sampled from its lower bound to its\nupper bound.', 'type': 'null'}, {'description': 'The dimensions or variables to sample from their upper bounds to\ntheir lower bounds.\nIf ``None``, every dimension will be sampled from its lower bound to its\nupper bound.', 'type': 'array', 'items': {'minItems': 1, 'type': 'string'}}]}, 'callbacks': {'description': 'The functions to be evaluated\nafter each call to :meth:`.OptimizationProblem.evaluate_functions`;\nto be called as ``callback(index, (output, jacobian))``.'}}, 'required': ['n_samples']}
Total running time of the script: (0 minutes 0.004 seconds)