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

Parallel depth-first search worker More...

#include <engine.hh>

Public Member Functions

 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 ~Worker (void)
 Destructor.
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 void run (void)=0
 The function that is executed when the thread starts.
virtual ~Runnable (void)
 Destructor.

Public Attributes

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.

Protected Attributes

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.

Detailed Description

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

Parallel depth-first search worker

Definition at line 49 of file engine.hh.

Constructor & Destructor Documentation

◆ Worker()

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

Initialize for space s with engine e.

Definition at line 95 of file engine.hpp.

◆ ~Worker()

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

Destructor.

Reimplemented in Gecode::Search::Par::BAB< Tracer >::Worker.

Definition at line 358 of file engine.hpp.

Member Function Documentation

◆ steal()

template<class Tracer>
Space * Gecode::Search::Par::Engine< Tracer >::Worker::steal ( unsigned long int & d,
Tracer & myt,
Tracer & ot )
inline

Hand over some work (NULL if no work available)

Definition at line 265 of file engine.hpp.

◆ statistics()

template<class Tracer>
Statistics Gecode::Search::Par::Engine< Tracer >::Worker::statistics ( void )
inline

Return statistics.

Definition at line 134 of file engine.hpp.

◆ engine()

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

Provide access to engine.

Definition at line 42 of file engine.hpp.

◆ nogoods()

template<class Tracer>
NoGoods & Gecode::Search::Par::Engine< Tracer >::Worker::nogoods ( void )
inline

Return no-goods.

Definition at line 289 of file engine.hpp.

◆ terminator()

template<class Tracer>
Support::Terminator * Gecode::Search::Par::Engine< Tracer >::Worker::terminator ( void ) const
virtual

Terminator (engine)

Reimplemented from Gecode::Support::Runnable.

Definition at line 350 of file engine.hpp.

Member Data Documentation

◆ tracer

template<class Tracer>
Tracer Gecode::Search::Par::Engine< Tracer >::Worker::tracer

Search tracer.

Definition at line 52 of file engine.hh.

◆ _engine

template<class Tracer>
Engine& Gecode::Search::Par::Engine< Tracer >::Worker::_engine
protected

Reference to engine.

Definition at line 55 of file engine.hh.

◆ m

template<class Tracer>
Support::Mutex Gecode::Search::Par::Engine< Tracer >::Worker::m
protected

Mutex for access to worker.

Definition at line 57 of file engine.hh.

◆ path

template<class Tracer>
Path<Tracer> Gecode::Search::Par::Engine< Tracer >::Worker::path
protected

Current path ins search tree.

Definition at line 59 of file engine.hh.

◆ cur

template<class Tracer>
Space* Gecode::Search::Par::Engine< Tracer >::Worker::cur
protected

Current space being explored.

Definition at line 61 of file engine.hh.

◆ d

template<class Tracer>
unsigned int Gecode::Search::Par::Engine< Tracer >::Worker::d
protected

Distance until next clone.

Definition at line 63 of file engine.hh.

◆ idle

template<class Tracer>
bool Gecode::Search::Par::Engine< Tracer >::Worker::idle
protected

Whether the worker is idle.

Definition at line 65 of file engine.hh.


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