BinPacking Class Reference
Example scripts (models)

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.
virtual IntVar | cost (void) const
| Return cost.
| BinPacking (BinPacking &s)
| Constructor for cloning s.
virtual Space * | copy (void)
| Copy during cloning.
virtual void | print (std::ostream &os) const
| Print solution.
Public Member Functions inherited from Gecode::Driver::ScriptBase< Driver::IgnoreStepOption< IntMinimizeSpace > >
| ScriptBase (const Options &opt)
| Constructor.
| ScriptBase (ScriptBase &e)
| Constructor used for cloning.
virtual void | compare (const Space &home, std::ostream &os) const
| Compare with s.
Public Member Functions inherited from Gecode::Driver::IgnoreStepOption< BaseSpace >
| IgnoreStepOption (const Options &)
| Constructor.
| IgnoreStepOption (BaseSpace &e)
| Constructor used for cloning.

## Protected Attributes

const Spec | spec
| Specification.
IntVarArray | load
| Load for each bin.
IntVarArray | bin
| Bin for each item.
IntVar | bins
| Number of bins.

## Related Symbols

(Note that these are not member symbols.)
int | main (int argc, char *argv[])
| Main-function.

## Additional Inherited Members

Static Public Member Functions inherited from Gecode::Driver::ScriptBase< Driver::IgnoreStepOption< IntMinimizeSpace > >
static std::ostream & | select_ostream (const char *sn, std::ofstream &ofs)
| Choose output stream according to sn.
static void | run (const Options &opt, Script *s=NULL)

## Detailed Description

Example: Bin packing

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

## Member Enumeration Documentation

## anonymous enum

anonymous enum

Model variants.

Enumerator
MODEL_NAIVE | Use naive model.
MODEL_PACKING | Use bin packing constraint.

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

## anonymous enum

anonymous enum

Branching to use for model.

Enumerator
BRANCH_NAIVE | Use naive branching.
BRANCH_CDBF | Use CDBF.

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

## Constructor & Destructor Documentation

## BinPacking() [1/2]

BinPacking::BinPacking | ( | const InstanceOptions & | opt | ) |

inline

Actual model.

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

## BinPacking() [2/2]

BinPacking::BinPacking | ( | BinPacking & | s | ) |

inline

Constructor for cloning s.

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

## Member Function Documentation

## cost()

virtual IntVar BinPacking::cost | ( | void |  | ) | const

inline virtual

Return cost.

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

## copy()

virtual Space * BinPacking::copy | ( | void |  | ) |

inline virtual

Copy during cloning.

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

## print()

virtual void BinPacking::print | ( | std::ostream & | os | ) | const

inline virtual

Print solution.

Reimplemented from Gecode::Driver::ScriptBase< Driver::IgnoreStepOption< IntMinimizeSpace > >.

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

## Friends And Related Symbol Documentation

## main()

int main | ( | int | argc,
|  | char * | argv[] )

related

Main-function.

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

## Member Data Documentation

## spec

const Spec BinPacking::spec

protected

Specification.

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

## load

IntVarArray BinPacking::load

protected

Load for each bin.

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

## bin

IntVarArray BinPacking::bin

protected

Bin for each item.

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

## bins

IntVar BinPacking::bins

protected

Number of bins.

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

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

- examples/bin-packing.cpp