Generated on Thu Jan 31 2019 20:56:45 for Gecode by doxygen 1.8.15
CDBF Class Reference

Custom brancher implementing CDBF. More...

Classes

class  Choice
 Choice More...
 

Public Member Functions

 CDBF (Home home, ViewArray< Int::IntView > &l, ViewArray< Int::IntView > &b, IntSharedArray &s)
 Construct brancher. More...
 
 CDBF (Space &home, bool share, CDBF &cdbf)
 Copy constructor. More...
 
virtual Actorcopy (Space &home, bool share)
 Copy brancher. More...
 
virtual size_t dispose (Space &home)
 Delete brancher and return its size. More...
 
virtual bool status (const Space &) const
 Check status of brancher, return true if alternatives left. More...
 
virtual Gecode::Choicechoice (Space &home)
 Return choice. More...
 
virtual const Gecode::Choicechoice (const Space &home, Archive &e)
 Return choice. More...
 
virtual ExecStatus commit (Space &home, const Gecode::Choice &_c, unsigned int a)
 Perform commit for choice _c and alternative a. More...
 
virtual void print (const Space &, const Gecode::Choice &_c, unsigned int a, std::ostream &o) const
 Print explanation. More...
 
- Public Member Functions inherited from Gecode::Brancher
virtual NGLngl (Space &home, const Choice &c, unsigned int a) const
 Create no-good literal for choice c and alternative a. More...
 
unsigned int id (void) const
 Return brancher id. More...
 
BrancherGroup group (void) const
 Return group brancher belongs to. More...
 
void group (BrancherGroup g)
 Add brancher to group g. More...
 
- Public Member Functions inherited from Gecode::Actor
virtual ~Actor (void)
 To avoid warnings. More...
 

Static Public Member Functions

static void post (Home home, ViewArray< Int::IntView > &l, ViewArray< Int::IntView > &b, IntSharedArray &s)
 Brancher post function. More...
 
- Static Public Member Functions inherited from Gecode::Actor
static void * operator new (size_t s)
 Not used. More...
 
static void operator delete (void *p)
 Not used. More...
 
static void * operator new (size_t s, Space &home)
 Allocate memory from space. More...
 
static void operator delete (void *p, Space &home)
 No-op for exceptions. More...
 

Protected Attributes

ViewArray< Int::IntViewload
 Views for the loads. More...
 
ViewArray< Int::IntViewbin
 Views for the bins. More...
 
IntSharedArray size
 Array of sizes (shared) More...
 
int item
 Next view to branch on. More...
 

Additional Inherited Members

- Protected Member Functions inherited from Gecode::Brancher
 Brancher (Home home)
 Constructor for creation. More...
 
 Brancher (Space &home, bool share, Brancher &b)
 Constructor for cloning b. More...
 

Detailed Description

Custom brancher implementing CDBF.

This class implements complete decreasing best fit branching (CDBF) from: Ian Gent and Toby Walsh. From approximate to optimal solutions: Constructing pruning and propagation rules. IJCAI 1997.

Additional domination rules are taken from: Paul Shaw. A Constraint for Bin Packing. CP 2004

Definition at line 202 of file bin-packing.cpp.

Constructor & Destructor Documentation

◆ CDBF() [1/2]

CDBF::CDBF ( Home  home,
ViewArray< Int::IntView > &  l,
ViewArray< Int::IntView > &  b,
IntSharedArray s 
)
inline

Construct brancher.

Definition at line 249 of file bin-packing.cpp.

◆ CDBF() [2/2]

CDBF::CDBF ( Space home,
bool  share,
CDBF cdbf 
)
inline

Copy constructor.

Definition at line 261 of file bin-packing.cpp.

Member Function Documentation

◆ post()

static void CDBF::post ( Home  home,
ViewArray< Int::IntView > &  l,
ViewArray< Int::IntView > &  b,
IntSharedArray s 
)
inlinestatic

Brancher post function.

Definition at line 255 of file bin-packing.cpp.

◆ copy()

virtual Actor* CDBF::copy ( Space home,
bool  share 
)
inlinevirtual

Copy brancher.

Implements Gecode::Actor.

Definition at line 268 of file bin-packing.cpp.

◆ dispose()

virtual size_t CDBF::dispose ( Space home)
inlinevirtual

Delete brancher and return its size.

Reimplemented from Gecode::Actor.

Definition at line 272 of file bin-packing.cpp.

◆ status()

virtual bool CDBF::status ( const Space ) const
inlinevirtual

Check status of brancher, return true if alternatives left.

Implements Gecode::Brancher.

Definition at line 279 of file bin-packing.cpp.

◆ choice() [1/2]

virtual Gecode::Choice* CDBF::choice ( Space home)
inlinevirtual

Return choice.

Implements Gecode::Brancher.

Definition at line 287 of file bin-packing.cpp.

◆ choice() [2/2]

virtual const Gecode::Choice* CDBF::choice ( const Space home,
Archive e 
)
inlinevirtual

Return choice.

Implements Gecode::Brancher.

Definition at line 340 of file bin-packing.cpp.

◆ commit()

virtual ExecStatus CDBF::commit ( Space home,
const Gecode::Choice _c,
unsigned int  a 
)
inlinevirtual

Perform commit for choice _c and alternative a.

Implements Gecode::Brancher.

Definition at line 349 of file bin-packing.cpp.

◆ print()

virtual void CDBF::print ( const Space ,
const Gecode::Choice _c,
unsigned int  a,
std::ostream &  o 
) const
inlinevirtual

Print explanation.

Reimplemented from Gecode::Brancher.

Definition at line 369 of file bin-packing.cpp.

Member Data Documentation

◆ load

ViewArray<Int::IntView> CDBF::load
protected

Views for the loads.

Definition at line 205 of file bin-packing.cpp.

◆ bin

ViewArray<Int::IntView> CDBF::bin
protected

Views for the bins.

Definition at line 207 of file bin-packing.cpp.

◆ size

IntSharedArray CDBF::size
protected

Array of sizes (shared)

Definition at line 209 of file bin-packing.cpp.

◆ item

int CDBF::item
mutableprotected

Next view to branch on.

Definition at line 211 of file bin-packing.cpp.


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