Struct Suite

Source
pub struct Suite { /* private fields */ }
Expand description

A COCO suite

Implementations§

Source§

impl Suite

Source

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.
Source

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).

Source

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).

Source

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).

Source

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.

Source

pub fn problem(&mut self, problem_idx: ProblemIdx) -> Option<Problem<'_>>

Returns the problem of the suite defined by problem_idx.

Source

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.

Source

pub fn number_of_problems(&self) -> usize

Returns the total number of problems in the suite.

Trait Implementations§

Source§

impl Clone for Suite

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Drop for Suite

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl Send for Suite

Auto Trait Implementations§

§

impl Freeze for Suite

§

impl RefUnwindSafe for Suite

§

impl !Sync for Suite

§

impl Unpin for Suite

§

impl UnwindSafe for Suite

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.