Generated on Tue Jul 18 2017 18:41:42 for Gecode by doxygen 1.8.13
Gecode::Search::Meta::Parallel::PBS< Collect > Class Template Reference

Parallel portfolio engine implementation. More...

#include <pbs.hh>

Public Member Functions

 PBS (Engine **s, Stop **so, unsigned int n, const Statistics &stat)
 Initialize. More...
 
virtual Spacenext (void)
 Return next solution (NULL, if none exists or search has been stopped) More...
 
virtual Statistics statistics (void) const
 Return statistics. More...
 
virtual bool stopped (void) const
 Check whether engine has been stopped. More...
 
virtual void constrain (const Space &b)
 Constrain future solutions to be better than b. More...
 
virtual ~PBS (void)
 Destructor. More...
 
- Public Member Functions inherited from Gecode::Search::Engine
virtual void reset (Space *s)
 Reset engine to restart at space s (does nothing) More...
 
virtual NoGoodsnogoods (void)
 Return no-goods (the no-goods are empty) More...
 
virtual ~Engine (void)
 Destructor. More...
 

Protected Member Functions

bool report (Slave< Collect > *slave, Space *s)
 Process report from slave, return false if solution was ignored. More...
 

Protected Attributes

Statistics stat
 Master statistics. More...
 
Slave< Collect > ** slaves
 Slave engines. More...
 
unsigned int n_slaves
 Number of slave engines. More...
 
bool slave_stop
 Whether a slave has been stopped. More...
 
volatile bool tostop
 Shared stop flag. More...
 
Collect solutions
 Collect solutions in this. More...
 
Support::Mutex m
 Mutex for synchronization. More...
 
unsigned int n_busy
 Number of busy slaves. More...
 
Support::Event idle
 Signal that number of busy slaves becomes zero. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from Gecode::HeapAllocated
static void * operator new (size_t s)
 Memory management. More...
 
static void operator delete (void *p)
 Free memory allocated from heap. More...
 

Detailed Description

template<class Collect>
class Gecode::Search::Meta::Parallel::PBS< Collect >

Parallel portfolio engine implementation.

Definition at line 67 of file pbs.hh.

Constructor & Destructor Documentation

◆ PBS()

template<class Collect >
Gecode::Search::Meta::Parallel::PBS< Collect >::PBS ( Engine **  s,
Stop **  so,
unsigned int  n,
const Statistics stat 
)
inline

Initialize.

Definition at line 155 of file pbs.hpp.

◆ ~PBS()

template<class Collect >
Gecode::Search::Meta::Parallel::PBS< Collect >::~PBS ( void  )
virtual

Destructor.

Definition at line 281 of file pbs.hpp.

Member Function Documentation

◆ report()

template<class Collect>
bool Gecode::Search::Meta::Parallel::PBS< Collect >::report ( Slave< Collect > *  slave,
Space s 
)
inlineprotected

Process report from slave, return false if solution was ignored.

Definition at line 168 of file pbs.hpp.

◆ next()

template<class Collect >
Space * Gecode::Search::Meta::Parallel::PBS< Collect >::next ( void  )
virtual

Return next solution (NULL, if none exists or search has been stopped)

Implements Gecode::Search::Engine.

Definition at line 209 of file pbs.hpp.

◆ statistics()

template<class Collect >
Statistics Gecode::Search::Meta::Parallel::PBS< Collect >::statistics ( void  ) const
virtual

Return statistics.

Implements Gecode::Search::Engine.

Definition at line 261 of file pbs.hpp.

◆ stopped()

template<class Collect >
bool Gecode::Search::Meta::Parallel::PBS< Collect >::stopped ( void  ) const
virtual

Check whether engine has been stopped.

Implements Gecode::Search::Engine.

Definition at line 255 of file pbs.hpp.

◆ constrain()

template<class Collect >
void Gecode::Search::Meta::Parallel::PBS< Collect >::constrain ( const Space b)
virtual

Constrain future solutions to be better than b.

Reimplemented from Gecode::Search::Engine.

Definition at line 270 of file pbs.hpp.

Member Data Documentation

◆ stat

template<class Collect>
Statistics Gecode::Search::Meta::Parallel::PBS< Collect >::stat
protected

Master statistics.

Definition at line 146 of file pbs.hh.

◆ slaves

template<class Collect>
Slave<Collect>** Gecode::Search::Meta::Parallel::PBS< Collect >::slaves
protected

Slave engines.

Definition at line 148 of file pbs.hh.

◆ n_slaves

template<class Collect>
unsigned int Gecode::Search::Meta::Parallel::PBS< Collect >::n_slaves
protected

Number of slave engines.

Definition at line 150 of file pbs.hh.

◆ slave_stop

template<class Collect>
bool Gecode::Search::Meta::Parallel::PBS< Collect >::slave_stop
protected

Whether a slave has been stopped.

Definition at line 152 of file pbs.hh.

◆ tostop

template<class Collect>
volatile bool Gecode::Search::Meta::Parallel::PBS< Collect >::tostop
protected

Shared stop flag.

Definition at line 154 of file pbs.hh.

◆ solutions

template<class Collect>
Collect Gecode::Search::Meta::Parallel::PBS< Collect >::solutions
protected

Collect solutions in this.

Definition at line 156 of file pbs.hh.

◆ m

template<class Collect>
Support::Mutex Gecode::Search::Meta::Parallel::PBS< Collect >::m
protected

Mutex for synchronization.

Definition at line 158 of file pbs.hh.

◆ n_busy

template<class Collect>
unsigned int Gecode::Search::Meta::Parallel::PBS< Collect >::n_busy
protected

Number of busy slaves.

Definition at line 160 of file pbs.hh.

◆ idle

template<class Collect>
Support::Event Gecode::Search::Meta::Parallel::PBS< Collect >::idle
protected

Signal that number of busy slaves becomes zero.

Definition at line 162 of file pbs.hh.


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