Template Class ecdf

Nested Relationships

Nested Types

Inheritance Relationships

Base Type

Class Documentation

template<class T>
class ioh::logger::ecdf : public ioh::logger::observer<T>

An observer which stores bi-dimensional error/evaluations discretized attainment matrices.

A matrix is stored for each triplet (problem,dimension,instance), everything being identified by its index. Attainment matrices are boolean 2D tables, in which a 1 indicates that an error target (row index) have been attained at an evaluation target (column index).

The whole set of matrices can be accessed by the get accessor. A single one can be accessed by the at accessor. Ranges can be get back by *_range accessors, which give access to the corresponding min && max functions (

Example:

using Logger = ecdf<BBOB_suite::Input_type>;
BBOB_suite bench({1,2},{1,2},{2,10});
Logger logger(0,4e7,0, 0,100,20);

BBOB_suite::Problem_ptr pb;
while(pb = bench.get_next_problem()) {
   logger.target_problem(*pb);
   // Make a `sol`
   for(size_t i=0; i<100; ++i) { // 100 evaluations
       double f = pb->evaluate(sol);
       logger.write_line(pb->loggerInfo());
   }
}
std::clog << logger.at(1,2,2) << std::endl;
See

range).

Unnamed Group

void activate_logger()

Not used, but part of the interface.

Observer interface

void track_suite(const suite::base<T>&) override

Not used, but part of the interface.

void track_problem(const T &pb) override

Initialize on the given problem.

void do_log(const std::vector<double> &infos) override

Actually store information about the last evaluation.

Should be called right after problem::evaluate, passing problem::loggerInfo().

Unnamed Group

const attain_suite &data()

Accessors Access all the data computed by this observer.

const attain_mat &at(size_t problem_id, size_t instance_id, size_t dim_id) const

Access a single attainment matrix.

First index: problem id, second index: instance id, third index: dimension id.

Note

Use the same indices order than problem.

std::tuple<size_t, size_t, size_t> size()

Returns the size of the computed data, in its internal order.

First index: number of problems, second index: number of dimensions, third index: number of instances.

Note

: the order of the indices is not the one used by logger interface!

range<double> &error_range()

Accessor to the range used for error targets in this logger instance.

range<size_t> &eval_range()

Accessor to the range used for evaluations targets in this logger instance.

Unnamed Group

void reset()

Clear all previously computed data structure.

Internal methods

void init_ecdf(const Problem &cur)

Create maps && matrix for this problem.

attain_mat &current_ecdf()

Returns the current attainment matrix.

void fill_up(size_t i_error, size_t j_evals)

Fill up the upper/upper quadrant of the attainment matrix with ones.

Take care of not losing time overwriting existing quadrants.

Unnamed Group

range<double> &_range_error

Range for the errors axis.

Internal members

range<size_t> &_range_evals

Range for the evaluations axis.

Problem _current

Currently targeted problem metadata.

attain_mat _empty

An attainment matrix filled with zeros, copied for each new problem/instance/dim.

attain_suite _ecdf_suite

The whole main data structure.

Public Types

using InputType = typename observer<T>::input_type

Scalar type of the solutions encoding the underlying (suite of) problems.

Public Functions

ecdf(const double error_min, const double error_max, const size_t error_buckets, const size_t evals_min, const size_t evals_max, const size_t evals_buckets)

Simple constructor that defaults to log-log scale.

ecdf(range<double> &error_buckets, range<size_t> &evals_buckets)

Complete constructor, with which you can define linear || semi-log scale.

See

RangeLinear

struct Problem

Internal types Keep essential metadata about the problem.

Public Members

int pb
int dim
int ins
bool has_opt
std::vector<double> opt
common::optimization_type maxmin