Generated on for Gecode by doxygen 1.17.0

Meta engine using a portfolio of search engines. More...

#include <gecode/search.hh>

Public Member Functions

 PBS (T *s, const Search::Options &o=Search::Options::def)
 Initialize with engines running copies of s with options o.
 PBS (T *s, SEBs &sebs, const Search::Options &o=Search::Options::def)
void constrain (const T &b)
 Constrain future portfolio solutions to be better than b.
Public Member Functions inherited from Gecode::Search::Base< T >
virtual T * next (void)
 Return next solution (nullptr, if none exists or search has been stopped).
virtual Statistics statistics (void) const
 Return statistics.
virtual bool stopped (void) const
 Check whether engine has been stopped.
virtual ~Base (void)
 Destructor.

Static Public Attributes

static const bool best = E<T>::best
 Whether engine does best solution search.

Protected Member Functions

void build (T *s, SEBs &sebs, const Search::Options &o)
 The actual build function.
Protected Member Functions inherited from Gecode::Search::Base< T >
 Base (Engine *e=nullptr)
 Constructor.

Additional Inherited Members

Static Public Member Functions inherited from Gecode::HeapAllocated
static void * operator new (size_t s)
 Memory management.
static void operator delete (void *p)
 Free memory allocated from heap.
Protected Attributes inherited from Gecode::Search::Base< T >
Engine * e
 The actual search engine.

Detailed Description

template<class T, template< class > class E = DFS>
class Gecode::PBS< T, E >

Meta engine using a portfolio of search engines.

The engine will run a portfolio with a number of assets as defined by the options o. The engine supports parallel execution of assets by using the number of threads as defined by the options. An external worker control in o is supported only for a single homogeneous asset. Multiple controlled assets require explicit engine builders, each with its own control and immutable worker capacity. PBS does not allocate workers or adjust those controls.

When the assets are restart-based engines, the portfolio takes ownership of the cutoff in o and the assets share its sequence: each restart of an asset takes the next value of the sequence.

The class T can implement member functions

virtual bool master(const MetaInfo& mi)
Information passed by meta search engines.
Definition core.hpp:1635

and

virtual bool slave(const MetaInfo& mi)

When the assets are created, these functions are executed. For more details, consult "Modeling and Programming with Gecode".

Definition at line 1563 of file search.hh.

Constructor & Destructor Documentation

◆ PBS() [1/2]

template<class T, template< class > class E>
Gecode::PBS< T, E >::PBS ( T * s,
const Search::Options & o = Search::Options::def )

Initialize with engines running copies of s with options o.

Definition at line 510 of file pbs.hpp.

◆ PBS() [2/2]

template<class T, template< class > class E>
Gecode::PBS< T, E >::PBS ( T * s,
SEBs & sebs,
const Search::Options & o = Search::Options::def )
inline

Initialize with engine builders sebs

The stop object of o is checked for each builder's engine with the statistics of that engine, as is the stop object of the builder.

The outer options must not contain a worker control. Each builder can instead supply a distinct control for its underlying engine. In parallel PBS, the outer thread count limits how many builders run, in array order; each builder's options set its own engine's thread count.

With experimental search, AStar and CABS builders can be used together with BAB builders.

Definition at line 606 of file pbs.hpp.

Member Function Documentation

◆ build()

template<class T, template< class > class E>
void Gecode::PBS< T, E >::build ( T * s,
SEBs & sebs,
const Search::Options & o )
protected

The actual build function.

Definition at line 562 of file pbs.hpp.

◆ constrain()

template<class T, template< class > class E>
void Gecode::PBS< T, E >::constrain ( const T & b)
inline

Constrain future portfolio solutions to be better than b.

Definition at line 612 of file pbs.hpp.

Member Data Documentation

◆ best

template<class T, template< class > class E = DFS>
const bool Gecode::PBS< T, E >::best = E<T>::best
static

Whether engine does best solution search.

Definition at line 1589 of file search.hh.


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