pub struct Suite { /* private fields */ }
Expand description
A COCO suite
Implementations§
Source§impl Suite
impl Suite
Sourcepub fn new(name: Name, instance: &str, options: &str) -> Option<Suite>
pub fn new(name: Name, instance: &str, options: &str) -> Option<Suite>
Instantiates the specified COCO suite.
§suite_instance
A string used for defining the suite instances. Two ways are supported:
- “year: YEAR”, where YEAR is the year of the BBOB workshop, includes the instances (to be) used in that year’s workshop;
- “instances: VALUES”, where VALUES are instance numbers from 1 on written as a comma-separated list or a range m-n.
§suite_options
A string of pairs “key: value” used to filter the suite (especially useful for parallelizing the experiments). Supported options:
- “dimensions: LIST”, where LIST is the list of dimensions to keep in the suite (range-style syntax is not allowed here),
- “dimension_indices: VALUES”, where VALUES is a list or a range of dimension indices (starting from 1) to keep in the suite, and
- “function_indices: VALUES”, where VALUES is a list or a range of function indices (starting from 1) to keep in the suite, and
- “instance_indices: VALUES”, where VALUES is a list or a range of instance indices (starting from 1) to keep in the suite.
Sourcepub fn function_from_function_index(&self, function_idx: FunctionIdx) -> usize
pub fn function_from_function_index(&self, function_idx: FunctionIdx) -> usize
Returns the function number in the suite in position function_idx (counting from 0).
Sourcepub fn dimension_from_dimension_index(
&self,
dimension_idx: DimensionIdx,
) -> usize
pub fn dimension_from_dimension_index( &self, dimension_idx: DimensionIdx, ) -> usize
Returns the dimension number in the suite in position dimension_idx (counting from 0).
Sourcepub fn instance_from_instance_index(&self, instance_idx: InstanceIdx) -> usize
pub fn instance_from_instance_index(&self, instance_idx: InstanceIdx) -> usize
Returns the instance number in the suite in position instance_idx (counting from 0).
Sourcepub fn next_problem<'s>(
&'s mut self,
observer: Option<&mut Observer>,
) -> Option<Problem<'s>>
pub fn next_problem<'s>( &'s mut self, observer: Option<&mut Observer>, ) -> Option<Problem<'s>>
Returns the next problem or None
when the suite completed.
Sourcepub fn problem(&mut self, problem_idx: ProblemIdx) -> Option<Problem<'_>>
pub fn problem(&mut self, problem_idx: ProblemIdx) -> Option<Problem<'_>>
Returns the problem of the suite defined by problem_idx.
Sourcepub fn problem_by_function_dimension_instance(
&mut self,
function: usize,
dimension: usize,
instance: usize,
) -> Option<Problem<'_>>
pub fn problem_by_function_dimension_instance( &mut self, function: usize, dimension: usize, instance: usize, ) -> Option<Problem<'_>>
Returns the problem for the given function, dimension and instance.
While a suite can contain multiple problems with equal function, dimension and instance, this
function always returns the first problem in the suite with the given function, dimension and instance
values. If the given values don’t correspond to a problem, the function returns None
.
Sourcepub fn number_of_problems(&self) -> usize
pub fn number_of_problems(&self) -> usize
Returns the total number of problems in the suite.