Generated on for Gecode by doxygen 1.17.0

Parallel A* search. More...

Public Member Functions

 AStar (Space *s, const Options &o)
 Initialize for space s with options o.
 ~AStar (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) 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.
virtual void started (const Space &r)
 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

Queue queue
 Open nodes.
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 A* search.

Definition at line 46 of file astar.cpp.

Constructor & Destructor Documentation

◆ AStar()

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

Initialize for space s with options o.

Definition at line 74 of file astar.cpp.

◆ ~AStar()

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

Destructor.

Definition at line 79 of file astar.cpp.

Member Function Documentation

◆ open()

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

Whether there are open nodes.

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

Definition at line 50 of file astar.cpp.

◆ select()

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

Remove and return the next open node.

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

Definition at line 53 of file astar.cpp.

◆ submit()

void Gecode::Search::Par::AStar::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 56 of file astar.cpp.

◆ advance()

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

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

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

Definition at line 66 of file astar.cpp.

◆ clear()

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

Delete all open nodes.

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

Definition at line 69 of file astar.cpp.

Member Data Documentation

◆ queue

Queue Gecode::Search::Par::AStar::queue
protected

Open nodes.

Definition at line 49 of file astar.cpp.


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