File: default_bfe.rst

package info (click to toggle)
pagmo 2.19.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 85,228 kB
  • sloc: cpp: 1,753,592; makefile: 223; sh: 121; python: 46
file content (47 lines) | stat: -rw-r--r-- 2,514 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
Default BFE
===========

.. versionadded:: 2.11

*#include <pagmo/batch_evaluators/default_bfe.hpp>*

.. cpp:namespace-push:: pagmo

.. cpp:class:: default_bfe

   This class is a user-defined batch fitness evaluator (UDBFE) that can be used to
   construct a :cpp:class:`~pagmo::bfe`.
   :cpp:class:`~pagmo::default_bfe` is the default UDBFE used by :cpp:class:`~pagmo::bfe`, and,
   depending on the properties of the input :cpp:class:`~pagmo::problem`, it will delegate the implementation
   of its call operator to :cpp:class:`~pagmo::member_bfe` or :cpp:class:`~pagmo::thread_bfe`.

   .. cpp:function:: vector_double operator()(const problem &p, const vector_double &dvs) const

      Call operator.

      The call operator will internally employ :cpp:class:`~pagmo::member_bfe` or :cpp:class:`~pagmo::thread_bfe`
      to perform the evaluation of the input batch of decision vectors *dvs*. The choice between :cpp:class:`~pagmo::member_bfe`
      and :cpp:class:`~pagmo::thread_bfe` is made according to the following heuristic:

      * if *p* provides a batch fitness member function (as established by :cpp:func:`pagmo::problem::has_batch_fitness()`),
        then a :cpp:class:`~pagmo::member_bfe` will be constructed and invoked to produce the return value; otherwise,
      * if *p* provides at least the :cpp:enumerator:`~pagmo::thread_safety::basic` thread safety level (as established
        by :cpp:func:`pagmo::problem::get_thread_safety()`), then a :cpp:class:`~pagmo::thread_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 :cpp:enumerator:`~pagmo::thread_safety::basic`
      thread safety level, an error will be raised.

      :param p: the input :cpp:class:`~pagmo::problem`.
      :param dvs: the input decision vectors that will be evaluated.

      :return: the fitness vectors corresponding to the input decision vectors in *dvs*.

      :exception 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 :cpp:enumerator:`~pagmo::thread_safety::basic` thread safety level.
      :exception unspecified: any exception raised by the call operator of :cpp:class:`~pagmo::member_bfe` or :cpp:class:`~pagmo::thread_bfe`.

   .. cpp:function:: std::string get_name() const

      :return: a human-readable name for this :cpp:class:`~pagmo::default_bfe`.

.. cpp:namespace-pop::