Default BFE#
New in version 2.11.
#include <pagmo/batch_evaluators/default_bfe.hpp>
-
class default_bfe#
This class is a user-defined batch fitness evaluator (UDBFE) that can be used to construct a
bfe
.default_bfe
is the default UDBFE used bybfe
, and, depending on the properties of the inputproblem
, it will delegate the implementation of its call operator tomember_bfe
orthread_bfe
.-
vector_double operator()(const problem &p, const vector_double &dvs) const#
Call operator.
The call operator will internally employ
member_bfe
orthread_bfe
to perform the evaluation of the input batch of decision vectors dvs. The choice betweenmember_bfe
andthread_bfe
is made according to the following heuristic:if p provides a batch fitness member function (as established by
pagmo::problem::has_batch_fitness()
), then amember_bfe
will be constructed and invoked to produce the return value; otherwise,if p provides at least the
basic
thread safety level (as established bypagmo::problem::get_thread_safety()
), then athread_bfe
will be constructed and invoked to produce the return value.
If p does not provide a batch fitness member function and if it does not provide at least the
basic
thread safety level, an error will be raised.- Parameters
p – the input
problem
.dvs – the input decision vectors that will be evaluated.
- Returns
the fitness vectors corresponding to the input decision vectors in dvs.
- Throws
std::invalid_argument – if the input problem p does not provide a batch fitness member function and it is does not provide at least the
basic
thread safety level.unspecified – any exception raised by the call operator of
member_bfe
orthread_bfe
.
-
std::string get_name() const#
- Returns
a human-readable name for this
default_bfe
.
-
vector_double operator()(const problem &p, const vector_double &dvs) const#