Ultra 0.9.4
Loading...
Searching...
No Matches
ultra::src::evaluator< D > Class Template Reference

#include <evaluator.h>

Inheritance diagram for ultra::src::evaluator< D >:
ultra::src::aggregate_evaluator< P, F, D, aggregation_mode::average, evaluation_mode::error > ultra::src::aggregate_evaluator< P, F, D, aggregation_mode::sum, evaluation_mode::error > ultra::src::aggregate_evaluator< P, F, D, aggregation_mode::average, evaluation_mode::score > ultra::src::aggregate_evaluator< P, F, D, aggregation_mode::sum, evaluation_mode::score > ultra::src::aggregate_evaluator< P, F, D, A, M >

Static Public Attributes

static constexpr std::size_t default_min_samples_per_thread = 512

Protected Member Functions

 evaluator (D &) noexcept
bool set_parallel_evaluation (unsigned, std::size_t=0) noexcept
const auto & data () const noexcept
std::size_t min_samples_per_thread () const noexcept
unsigned parallel_helpers () const noexcept

Detailed Description

template<EvaluationDataset D>
class ultra::src::evaluator< D >

Base class for dataset-aware evaluators.

Template Parameters
Ddataset type

This class stores a reference to a dataset and provides a uniform access interface for both plain datasets and multi_dataset specialisations. It is intended to be used as a protected base class for concrete evaluators.

Constructor & Destructor Documentation

◆ evaluator()

template<EvaluationDataset D>
evaluator::evaluator ( D & d)
explicitprotectednoexcept

Constructs the evaluator bound to a dataset.

Parameters
[in]ddataset used for fitness evaluation

Member Function Documentation

◆ data()

template<EvaluationDataset D>
const auto & evaluator::data ( ) const
nodiscardprotectednoexcept

Returns the dataset currently used for evaluation.

Returns
reference to the active dataset

For multi_dataset, this returns the currently selected dataset. Otherwise, it returns the dataset itself.

◆ min_samples_per_thread()

template<EvaluationDataset D>
std::size_t evaluator::min_samples_per_thread ( ) const
nodiscardprotectednoexcept

Returns the effective minimum number of dataset examples per evaluation thread, including the default selected when zero was configured.

Returns
minimum number of samples per thread

◆ parallel_helpers()

template<EvaluationDataset D>
unsigned evaluator::parallel_helpers ( ) const
nodiscardprotectednoexcept

Returns the configured number of helper threads for parallel evaluation.

Returns
number of helper threads

◆ set_parallel_evaluation()

template<EvaluationDataset D>
bool evaluator::set_parallel_evaluation ( unsigned helpers,
std::size_t min_samples = 0 )
protectednoexcept

Sets the number of helper threads and workload threshold for parallel evaluation.

Parameters
[in]helpersnumber of helper threads; zero disables parallel evaluation
[in]min_samplesminimum number of samples per thread; zero uses the default threshold
Returns
true after applying the configuration

The documentation for this class was generated from the following files: