Example: Bin packing More...
Public Types | |
enum | { MODEL_NAIVE, MODEL_PACKING } |
Model variants. More... | |
enum | { BRANCH_NAIVE, BRANCH_CDBF } |
Branching to use for model. More... | |
Public Member Functions | |
BinPacking (const InstanceOptions &opt) | |
Actual model. More... | |
virtual IntVar | cost (void) const |
Return cost. More... | |
BinPacking (bool share, BinPacking &s) | |
Constructor for cloning s. More... | |
virtual Space * | copy (bool share) |
Copy during cloning. More... | |
virtual void | print (std::ostream &os) const |
Print solution. More... | |
![]() | |
ScriptBase (const Options &opt) | |
Constructor. More... | |
ScriptBase (bool share, ScriptBase &e) | |
Constructor used for cloning. More... | |
virtual void | compare (const Space &home, std::ostream &os) const |
Compare with s. More... | |
Protected Attributes | |
const Spec | spec |
Specification. More... | |
IntVarArray | load |
Load for each bin. More... | |
IntVarArray | bin |
Bin for each item. More... | |
IntVar | bins |
Number of bins. More... | |
Related Functions | |
(Note that these are not member functions.) | |
int | main (int argc, char *argv[]) |
Main-function. More... | |
Additional Inherited Members | |
![]() | |
static std::ostream & | select_ostream (const char *sn, std::ofstream &ofs) |
Choose output stream according to sn. More... | |
template<class Script , template< class > class Engine, class Options > | |
static void | run (const Options &opt, Script *s=NULL) |
Example: Bin packing
Definition at line 407 of file bin-packing.cpp.
anonymous enum |
Model variants.
Enumerator | |
---|---|
MODEL_NAIVE | Use naive model. |
MODEL_PACKING | Use bin packing constraint. |
Definition at line 419 of file bin-packing.cpp.
anonymous enum |
Branching to use for model.
Enumerator | |
---|---|
BRANCH_NAIVE | Use naive branching. |
BRANCH_CDBF | Use CDBF. |
Definition at line 424 of file bin-packing.cpp.
|
inline |
Actual model.
Definition at line 429 of file bin-packing.cpp.
|
inline |
Constructor for cloning s.
Definition at line 508 of file bin-packing.cpp.
|
inlinevirtual |
Return cost.
Definition at line 504 of file bin-packing.cpp.
|
inlinevirtual |
Copy during cloning.
Definition at line 516 of file bin-packing.cpp.
|
inlinevirtual |
Print solution.
Reimplemented from Gecode::Driver::ScriptBase< BaseSpace >.
Definition at line 521 of file bin-packing.cpp.
|
related |
Main-function.
Definition at line 553 of file bin-packing.cpp.
|
protected |
Specification.
Definition at line 410 of file bin-packing.cpp.
|
protected |
Load for each bin.
Definition at line 412 of file bin-packing.cpp.
|
protected |
Bin for each item.
Definition at line 414 of file bin-packing.cpp.
|
protected |
Number of bins.
Definition at line 416 of file bin-packing.cpp.