Generated on Thu Jan 16 2025 00:00:00 for Gecode by doxygen 1.14.0
Gecode::Search::Par::BAB< Tracer >::Worker Class Reference

Parallel branch-and-bound search worker More...

#include <bab.hh>

Public Member Functions

 Worker (Space *s, BAB &e)
 Initialize for space s with engine e.
BABengine (void) const
 Provide access to engine.
virtual void run (void)
 Start execution of worker.
void better (Space *b)
 Accept better solution b.
void find (void)
 Try to find some work.
void reset (Space *s, unsigned int ngdl)
 Reset engine to restart at space s.
virtual ~Worker (void)
 Destructor.
Public Member Functions inherited from Gecode::Search::Par::Engine< Tracer >::Worker
 Worker (Space *s, Engine &e)
 Initialize for space s with engine e.
Spacesteal (unsigned long int &d, Tracer &myt, Tracer &ot)
 Hand over some work (NULL if no work available)
Statistics statistics (void)
 Return statistics.
Engineengine (void) const
 Provide access to engine.
NoGoodsnogoods (void)
 Return no-goods.
virtual Support::Terminatorterminator (void) const
 Terminator (engine)
Public Member Functions inherited from Gecode::Search::Worker
 Worker (void)
 Initialize.
void start (void)
 Reset stop information.
bool stop (const Options &o)
 Check whether engine must be stopped.
bool stopped (void) const
 Check whether engine has been stopped.
void reset (unsigned long int d=0)
 Reset statistics with root depth d.
void stack_depth (unsigned long int d)
 Record stack depth d.
unsigned long int steal_depth (unsigned long int d) const
 Return steal depth.
Public Member Functions inherited from Gecode::Search::Statistics
 Statistics (void)
 Initialize.
void reset (void)
 Reset.
Statistics operator+ (const Statistics &s)
 Return sum with s.
Statisticsoperator+= (const Statistics &s)
 Increment by statistics s.
Public Member Functions inherited from Gecode::StatusStatistics
 StatusStatistics (void)
 Initialize.
void reset (void)
 Reset information.
StatusStatistics operator+ (const StatusStatistics &s)
 Return sum with s.
StatusStatisticsoperator+= (const StatusStatistics &s)
 Increment by statistics s.
Public Member Functions inherited from Gecode::Support::Runnable
 Runnable (bool d=true)
 Initialize, d defines whether object is deleted when terminated.
void todelete (bool d)
 Set whether to delete upon termination.
bool todelete (void) const
 Return whether to be deleted upon termination.
virtual ~Runnable (void)
 Destructor.

Protected Attributes

int mark
 Number of entries not yet constrained to be better.
Spacebest
 Best solution found so far.
Protected Attributes inherited from Gecode::Search::Par::Engine< Tracer >::Worker
Engine_engine
 Reference to engine.
Support::Mutex m
 Mutex for access to worker.
Path< Tracerpath
 Current path ins search tree.
Spacecur
 Current space being explored.
unsigned int d
 Distance until next clone.
bool idle
 Whether the worker is idle.
Protected Attributes inherited from Gecode::Search::Worker
bool _stopped
 Whether engine has been stopped.
unsigned long int root_depth
 Depth of root node (for work stealing)

Additional Inherited Members

Static Public Member Functions inherited from Gecode::Support::Runnable
static void * operator new (size_t s)
 Allocate memory from heap.
static void operator delete (void *p)
 Free memory allocated from heap.
Public Attributes inherited from Gecode::Search::Par::Engine< Tracer >::Worker
Tracer tracer
 Search tracer.
Public Attributes inherited from Gecode::Search::Statistics
unsigned long int fail
 Number of failed nodes in search tree.
unsigned long int node
 Number of nodes expanded.
unsigned long int depth
 Maximum depth of search stack.
unsigned long int restart
 Number of restarts.
unsigned long int nogood
 Number of no-goods posted.
Public Attributes inherited from Gecode::StatusStatistics
unsigned long int propagate
 Number of propagator executions.

Detailed Description

template<class Tracer>
class Gecode::Search::Par::BAB< Tracer >::Worker

Parallel branch-and-bound search worker

Definition at line 66 of file bab.hh.

Constructor & Destructor Documentation

◆ Worker()

template<class Tracer>
Gecode::Search::Par::BAB< Tracer >::Worker::Worker ( Space * s,
BAB & e )
inline

Initialize for space s with engine e.

Definition at line 76 of file bab.hpp.

◆ ~Worker()

template<class Tracer>
Gecode::Search::Par::BAB< Tracer >::Worker::~Worker ( void )
virtual

Destructor.

Reimplemented from Gecode::Search::Par::Engine< Tracer >::Worker.

Definition at line 411 of file bab.hpp.

Member Function Documentation

◆ engine()

template<class Tracer>
BAB< Tracer > & Gecode::Search::Par::BAB< Tracer >::Worker::engine ( void ) const
inline

Provide access to engine.

Definition at line 41 of file bab.hpp.

◆ run()

template<class Tracer>
void Gecode::Search::Par::BAB< Tracer >::Worker::run ( void )
virtual

Start execution of worker.

Implements Gecode::Support::Runnable.

Definition at line 209 of file bab.hpp.

◆ better()

template<class Tracer>
void Gecode::Search::Par::BAB< Tracer >::Worker::better ( Space * b)
inline

Accept better solution b.

Definition at line 106 of file bab.hpp.

◆ find()

template<class Tracer>
void Gecode::Search::Par::BAB< Tracer >::Worker::find ( void )
inline

Try to find some work.

Definition at line 148 of file bab.hpp.

◆ reset()

template<class Tracer>
void Gecode::Search::Par::BAB< Tracer >::Worker::reset ( Space * s,
unsigned int ngdl )
inline

Reset engine to restart at space s.

Definition at line 52 of file bab.hpp.

Member Data Documentation

◆ mark

template<class Tracer>
int Gecode::Search::Par::BAB< Tracer >::Worker::mark
protected

Number of entries not yet constrained to be better.

Definition at line 80 of file bab.hh.

◆ best

template<class Tracer>
Space* Gecode::Search::Par::BAB< Tracer >::Worker::best
protected

Best solution found so far.

Definition at line 82 of file bab.hh.


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