Generated on for Gecode by doxygen 1.17.0

Parallel complete anytime beam search. More...

Public Member Functions

 CABS (Space *s, const Options &o)
 Initialize for space s with options o.
 ~CABS (void) override
 Destructor.
 ~Frontier (void) override
 Destructor.
Space * next (void) override
 Return next better solution (nullptr if none or stopped).
Search::Statistics statistics (void) const override
 Return statistics.
bool stopped (void) const override
 Whether search has been stopped.
bool limited (void) const override
 Whether search stopped at the width or frontier limit.
void constrain (const Space &s) override
 Constrain future solutions to be better than s.
void reset (Space *s) override
 Reset engine to restart at space s.
Public Member Functions inherited from Gecode::Search::Engine
virtual NoGoods & nogoods (void)
 Return no-goods (the no-goods are empty).
virtual ~Engine (void)
 Destructor.

Protected Member Functions

bool open (void) const override
 Whether there are open nodes.
Entry select (void) override
 Remove and return the next open node.
void submit (const Entry &e, bool leased) override
 Add child e, or delete it; leased tells whether its parent is still leased.
bool advance (void) override
 Called when all work is done, return whether there is new work.
void clear (void) override
 Delete all open nodes.
void started (const Space &r) override
 Called with the root r when search starts.
 Frontier (const Options &o)
 Initialize with options o.
void initialize (Space *s, bool clone)
 Start search from root s.
void push (Task *t)
 Add pending task t.
void terminate (void)
 Stop all workers (must be called by subclass destructors).
void publish (Space *s, std::int64_t b)
 Make s with bound b the incumbent, if it improves.
void launch (void)
 Start the threads.
void wake (void)
 Wake up all workers.
bool enabled (unsigned int id)
 Whether worker id is currently enabled.
void work (unsigned int id)
 Run worker id.
Protected Member Functions inherited from Gecode::Search::Engine
 Engine (void)
 Construct a meta engine without worker control.
 Engine (const Options &o, unsigned int capacity)
 Construct a leaf engine and bind worker control to capacity.

Protected Attributes

Priority priority
 Order of nodes in a layer.
std::unique_ptr< Space > root
 Root for restarting with a wider beam.
Entries layer
 Nodes of the current layer, preferred node on top.
Beam candidates
 Candidates for the next layer.
Protected Attributes inherited from Gecode::Search::Par::Frontier
Options opt
 Search options.
HeuristicGuidance guidance
 Guidance.
Incumbent best
 Best solution so far.
std::unique_ptr< Space > solution
 Solution to be returned by next().
unsigned long long int order
 Number of created entries.
Support::DynamicQueue< Task *, Heap > pending
 Partially expanded nodes.
unsigned int n_pending
 Number of partially expanded nodes.
Runner ** runners
 The threads (allocated on first next()).
Support::Mutex mutex
 Mutex protecting all data.
Support::Event changed
 Signalled when search is idle.
Search::Statistics stat
 Statistics.
unsigned int active
 Number of workers holding a task.
bool running
 Whether search is running, being shut down, stopped, or limited.
bool shutdown
bool _stopped
bool _limited
std::exception_ptr error
 First exception thrown by a worker.
unsigned int batch
 Number of children a worker collects before submitting.
bool keyed
 Whether to compute dominance keys.
Protected Attributes inherited from Gecode::Search::Engine
WorkerControl worker_control
 Control retained for the lifetime of a leaf engine.

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.
static const unsigned int max_batch = 8
 Maximal number of children a worker collects before submitting.

Detailed Description

Parallel complete anytime beam search.

Definition at line 46 of file cabs.cpp.

Constructor & Destructor Documentation

◆ CABS()

Gecode::Search::Par::CABS::CABS ( Space * s,
const Options & o )
inline

Initialize for space s with options o.

Definition at line 108 of file cabs.cpp.

◆ ~CABS()

Gecode::Search::Par::CABS::~CABS ( void )
inlineoverride

Destructor.

Definition at line 116 of file cabs.cpp.

Member Function Documentation

◆ open()

bool Gecode::Search::Par::CABS::open ( void ) const
inlineoverrideprotectedvirtual

Whether there are open nodes.

Implements Gecode::Search::Par::Frontier.

Definition at line 56 of file cabs.cpp.

◆ select()

Entry Gecode::Search::Par::CABS::select ( void )
inlineoverrideprotectedvirtual

Remove and return the next open node.

Implements Gecode::Search::Par::Frontier.

Definition at line 59 of file cabs.cpp.

◆ submit()

void Gecode::Search::Par::CABS::submit ( const Entry & e,
bool leased )
inlineoverrideprotectedvirtual

Add child e, or delete it; leased tells whether its parent is still leased.

Implements Gecode::Search::Par::Frontier.

Definition at line 62 of file cabs.cpp.

◆ advance()

bool Gecode::Search::Par::CABS::advance ( void )
inlineoverrideprotectedvirtual

Called when all work is done, return whether there is new work.

Implements Gecode::Search::Par::Frontier.

Definition at line 80 of file cabs.cpp.

◆ clear()

void Gecode::Search::Par::CABS::clear ( void )
inlineoverrideprotectedvirtual

Delete all open nodes.

Implements Gecode::Search::Par::Frontier.

Definition at line 98 of file cabs.cpp.

◆ started()

void Gecode::Search::Par::CABS::started ( const Space & r)
inlineoverrideprotectedvirtual

Called with the root r when search starts.

Reimplemented from Gecode::Search::Par::Frontier.

Definition at line 103 of file cabs.cpp.

Member Data Documentation

◆ priority

Priority Gecode::Search::Par::CABS::priority
protected

Order of nodes in a layer.

Definition at line 49 of file cabs.cpp.

◆ root

std::unique_ptr<Space> Gecode::Search::Par::CABS::root
protected

Root for restarting with a wider beam.

Definition at line 51 of file cabs.cpp.

◆ layer

Entries Gecode::Search::Par::CABS::layer
protected

Nodes of the current layer, preferred node on top.

Definition at line 53 of file cabs.cpp.

◆ candidates

Beam Gecode::Search::Par::CABS::candidates
protected

Candidates for the next layer.

Definition at line 55 of file cabs.cpp.


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