Struct Observer

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

An observer to log results in COCO’s data format.

Can be provided to Suite::next_problem and it will automatically be attached to the returned problem.

Implementations§

Source§

impl Observer

Source

pub fn new(name: Name, options: &str) -> Option<Observer>

Creates a new observer.

§observer_options

A string of pairs “key: value” used to pass the options to the observer. Some observer options are general, while others are specific to some observers. Here we list only the general options, see observer_bbob, observer_biobj and observer_toy for options of the specific observers.

  • “result_folder: NAME” determines the folder within the “exdata” folder into which the results will be output. If the folder with the given name already exists, first NAME_001 will be tried, then NAME_002 and so on. The default value is “default”.
  • “algorithm_name: NAME”, where NAME is a short name of the algorithm that will be used in plots (no spaces are allowed). The default value is “ALG”.
  • “algorithm_info: STRING” stores the description of the algorithm. If it contains spaces, it must be surrounded by double quotes. The default value is “” (no description).
  • “number_target_triggers: VALUE” defines the number of targets between each 10^i and 10^(i+1) (equally spaced in the logarithmic scale) that trigger logging. The default value is 100.
  • “target_precision: VALUE” defines the precision used for targets (there are no targets for abs(values) < target_precision). The default value is 1e-8.
  • “number_evaluation_triggers: VALUE” defines the number of evaluations to be logged between each 10^i and 10^(i+1). The default value is 20.
  • “base_evaluation_triggers: VALUES” defines the base evaluations used to produce an additional evaluation-based logging. The numbers of evaluations that trigger logging are every base_evaluation * dimension * (10^i). For example, if base_evaluation_triggers = “1,2,5”, the logger will be triggered by evaluations dim1, dim2, dim5, 10dim1, 10dim2, 10dim5, 100dim1, 100dim2, 100dim*5, … The default value is “1,2,5”.
  • “precision_x: VALUE” defines the precision used when outputting variables and corresponds to the number of digits to be printed after the decimal point. The default value is 8.
  • “precision_f: VALUE” defines the precision used when outputting f values and corresponds to the number of digits to be printed after the decimal point. The default value is 15.
  • “precision_g: VALUE” defines the precision used when outputting constraints and corresponds to the number of digits to be printed after the decimal point. The default value is 3.
  • “log_discrete_as_int: VALUE” determines whether the values of integer variables (in mixed-integer problems) are logged as integers (1) or not (0 - in this case they are logged as doubles). The default value is 0.
Source

pub fn result_folder(&self) -> &str

Prints where the result is written to.

Trait Implementations§

Source§

impl Drop for Observer

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

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