algorithm_configuration module¶
Configuration of an algorithm defined by the values of its options.
An algorithm depends on the values of its options. A value set defines a configuration of the algorithm.
- class gemseo_benchmark.algorithms.algorithm_configuration.AlgorithmConfiguration(algorithm_name, configuration_name=None, instance_algorithm_options=mappingproxy({}), **algorithm_options)[source]¶
Bases:
object
The configuration of an algorithm.
- Parameters:
algorithm_name (str) – The name of the algorithm.
configuration_name (str | None) – The name of the configuration of the algorithm. If
None
, a name will be generated based on the algorithm name and its options, based on the pattern"algorithm_name[option_name=option_value, ...]"
.instance_algorithm_options (InstanceAlgorithmOptions) –
The options of the algorithm specific to instances of a problem. They shall be passed as a mapping that links the name of an algorithm option to a callable that takes the 0-based index of the instance as argument and returns the value of the option.
By default it is set to {}.
**algorithm_options (Any) – The options of the algorithm.
- copy()[source]¶
Return a copy of the algorithm configuration.
- Returns:
A copy of the algorithm configuration.
- Return type:
- classmethod from_dict(algorithm_configuration)[source]¶
Load an algorithm configuration from a dictionary.
- to_dict(skip_instance_algorithm_options=False)[source]¶
Return the algorithm configuration as a dictionary.