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. | |
CDBF (Space &home, CDBF &cdbf) | |
Copy constructor. | |
virtual Actor * | copy (Space &home) |
Copy brancher. | |
virtual size_t | dispose (Space &home) |
Delete brancher and return its size. | |
virtual bool | status (const Space &) const |
Check status of brancher, return true if alternatives left. | |
virtual Gecode::Choice * | choice (Space &) |
Return choice. | |
virtual const Gecode::Choice * | choice (const Space &, Archive &e) |
Return choice. | |
virtual ExecStatus | commit (Space &home, const Gecode::Choice &_c, unsigned int a) |
Perform commit for choice _c and alternative a. | |
virtual void | print (const Space &, const Gecode::Choice &_c, unsigned int a, std::ostream &o) const |
Print explanation. | |
virtual NGL * | ngl (Space &home, const Choice &c, unsigned int a) const |
Create no-good literal for choice c and alternative a. | |
unsigned int | id (void) const |
Return brancher id. | |
BrancherGroup | group (void) const |
Return group brancher belongs to. | |
void | group (BrancherGroup g) |
Add brancher to group g. | |
virtual | ~Actor (void) |
To avoid warnings. |
Static Public Member Functions | |
static void | post (Home home, ViewArray< Int::IntView > &l, ViewArray< Int::IntView > &b, IntSharedArray &s) |
Brancher post function. | |
static void * | operator new (size_t s, Space &home) |
Allocate memory from space. | |
static void | operator delete (void *p, Space &home) |
No-op for exceptions. | |
static void * | operator new (size_t s) |
Not used. | |
static void | operator delete (void *p) |
Not used. |
Protected Attributes | |
ViewArray< Int::IntView > | load |
Views for the loads. | |
ViewArray< Int::IntView > | bin |
Views for the bins. | |
IntSharedArray | size |
Array of sizes (shared) | |
int | item |
Next view to branch on. |
Additional Inherited Members | |
Protected Member Functions inherited from Gecode::Brancher | |
Brancher (Home home) | |
Constructor for creation. | |
Brancher (Space &home, Brancher &b) | |
Constructor for cloning b. |
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 198 of file bin-packing.cpp.
|
inline |
Construct brancher.
Definition at line 241 of file bin-packing.cpp.
Copy constructor.
Definition at line 253 of file bin-packing.cpp.
|
inlinestatic |
Brancher post function.
Definition at line 247 of file bin-packing.cpp.
|
inlinevirtual |
Delete brancher and return its size.
Reimplemented from Gecode::Actor.
Definition at line 263 of file bin-packing.cpp.
|
inlinevirtual |
Check status of brancher, return true if alternatives left.
Implements Gecode::Brancher.
Definition at line 270 of file bin-packing.cpp.
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
Perform commit for choice _c and alternative a.
Implements Gecode::Brancher.
Definition at line 340 of file bin-packing.cpp.
|
inlinevirtual |
Print explanation.
Reimplemented from Gecode::Brancher.
Definition at line 360 of file bin-packing.cpp.
|
protected |
Views for the loads.
Definition at line 201 of file bin-packing.cpp.
|
protected |
Views for the bins.
Definition at line 203 of file bin-packing.cpp.
|
protected |
Array of sizes (shared)
Definition at line 205 of file bin-packing.cpp.
|
mutableprotected |
Next view to branch on.
Definition at line 207 of file bin-packing.cpp.