Generated on for Gecode by doxygen 1.18.0
Gecode::Search::Beam Class Reference

Candidates for the next layer of CABS. More...

#include <gecode/search/heuristic.hh>

Public Types

enum  Offer { TAKEN , FULL }
 Result of offering an entry. More...

Public Member Functions

 Beam (const Priority &p0, bool keyed)
 Initialize with priority p, using keys for dominance if keyed.
 ~Beam (void)
 Delete all entries.
int size (void) const
 Return the number of entries.
bool empty (void) const
 Whether there are no entries.
bool improving (const Incumbent &i) const
 Whether discarded entries could improve an incumbent i.
bool widen (unsigned long int m)
 Double the width up to m (zero for no limit), false if not possible.
Offer offer (const Entry &e, const HeuristicGuidance &g, bool room)
 Offer entry e.
void release (Entries &l)
 Move all entries to l.
void clear (void)
 Delete all entries and reset width.

Detailed Description

Candidates for the next layer of CABS.

Keeps at most as many entries as the current width, with the least preferred one on top. Entries are stored in fixed slots so that slots with the same dominance key can be chained for dominance checks.

Definition at line 172 of file heuristic.hh.

Member Enumeration Documentation

◆ Offer

Result of offering an entry.

Enumerator
TAKEN 

The entry has been added or deleted.

FULL 

The entry needs a new slot but there is no room.

Definition at line 175 of file heuristic.hh.

Constructor & Destructor Documentation

◆ Beam()

Gecode::Search::Beam::Beam ( const Priority & p0,
bool keyed )
inline

Initialize with priority p, using keys for dominance if keyed.

Definition at line 304 of file heuristic.hh.

◆ ~Beam()

Gecode::Search::Beam::~Beam ( void )
inline

Delete all entries.

Definition at line 311 of file heuristic.hh.

Member Function Documentation

◆ size()

int Gecode::Search::Beam::size ( void ) const
inline

Return the number of entries.

Definition at line 313 of file heuristic.hh.

◆ empty()

bool Gecode::Search::Beam::empty ( void ) const
inline

Whether there are no entries.

Definition at line 315 of file heuristic.hh.

◆ improving()

bool Gecode::Search::Beam::improving ( const Incumbent & i) const
inline

Whether discarded entries could improve an incumbent i.

Definition at line 317 of file heuristic.hh.

◆ widen()

bool Gecode::Search::Beam::widen ( unsigned long int m)
inline

Double the width up to m (zero for no limit), false if not possible.

Definition at line 321 of file heuristic.hh.

◆ offer()

Offer Gecode::Search::Beam::offer ( const Entry & e,
const HeuristicGuidance & g,
bool room )
inline

Offer entry e.

Deletes e if a candidate dominates it or if the beam is full and all candidates are preferred. Deletes candidates that e dominates and the least preferred candidate if e replaces it. Returns FULL without deleting e if e needs a new slot and room is false.

Definition at line 335 of file heuristic.hh.

◆ release()

void Gecode::Search::Beam::release ( Entries & l)
inline

Move all entries to l.

Definition at line 374 of file heuristic.hh.

◆ clear()

void Gecode::Search::Beam::clear ( void )
inline

Delete all entries and reset width.

Definition at line 382 of file heuristic.hh.


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