Generated on Sat Nov 11 01:12:18 2006 for Gecode by doxygen 1.5.1

Packing Class Reference
[Example scripts (models)]

Inherits Example.

List of all members.


Detailed Description

Example: packing squares into a rectangle

Definition at line 81 of file packing.cc.

Specifications for packing problems

static const int s0_s [] = {2,2,2,2,0}
static const PackingSpec s0 (4, 4, s0_s)
static const int s1_s [] = {3,2,2,1,1,1,0}
static const PackingSpec s1 (5, 4, s1_s)
static const int s2_s [] = {6,4,4,4,2,2,2,2,0}
static PackingSpec s2 (10, 10, s2_s)
static const int s3_s [] = {9,8,8,7,5,4,4,4,4,4,3,3,3,2,2,1,1,0}
static const PackingSpec s3 (20, 20, s3_s)
static const int s4_s [] = {18,15,14,10,9,8,7,4,1,0}
static const PackingSpec s4 (32, 33, s4_s)
static const int s5_s [] = {25,24,23,22,19,17,11,6,5,3,0}
static const PackingSpec s5 (65, 47, s5_s)
static const int s6_s []
static const PackingSpec s6 (112, 112, s6_s)
static const int s7_s []
static const PackingSpec s7 (175, 175, s7_s)
static const PackingSpecspecs [] = {&s0,&s1,&s2,&s3,&s4,&s5,&s6,&s7}
static const unsigned int n_examples = sizeof(specs) / sizeof(PackingSpec*)

Public Member Functions

 Packing (const Options &opt)
 Actual model.
 Packing (bool share, Packing &s)
 Constructor for cloning s.
virtual Spacecopy (bool share)
 Copy during cloning.
virtual void print (void)
 Print solution.

Protected Attributes

const PackingSpecs
 Specification used.
IntVarArray x
 Array of x-coordinates of squares.
IntVarArray y
 Array of y-coordinates of squares.


Constructor & Destructor Documentation

Packing::Packing ( const Options opt  )  [inline]

Actual model.

Definition at line 91 of file packing.cc.

Packing::Packing ( bool  share,
Packing s 
) [inline]

Constructor for cloning s.

Definition at line 173 of file packing.cc.


Member Function Documentation

virtual Space* Packing::copy ( bool  share  )  [inline, virtual]

Copy during cloning.

Implements Gecode::Space.

Definition at line 179 of file packing.cc.

virtual void Packing::print ( void   )  [inline, virtual]

Print solution.

Reimplemented from Example.

Definition at line 184 of file packing.cc.


Friends And Related Function Documentation

const int s0_s[] = {2,2,2,2,0} [related]

Definition at line 46 of file packing.cc.

const PackingSpec s0(4, 4, s0_s) [related]

const int s1_s[] = {3,2,2,1,1,1,0} [related]

Definition at line 49 of file packing.cc.

const PackingSpec s1(5, 4, s1_s) [related]

const int s2_s[] = {6,4,4,4,2,2,2,2,0} [related]

Definition at line 52 of file packing.cc.

PackingSpec s2(10, 10, s2_s) [related]

const int s3_s[] = {9,8,8,7,5,4,4,4,4,4,3,3,3,2,2,1,1,0} [related]

Definition at line 55 of file packing.cc.

const PackingSpec s3(20, 20, s3_s) [related]

const int s4_s[] = {18,15,14,10,9,8,7,4,1,0} [related]

Definition at line 58 of file packing.cc.

const PackingSpec s4(32, 33, s4_s) [related]

const int s5_s[] = {25,24,23,22,19,17,11,6,5,3,0} [related]

Definition at line 61 of file packing.cc.

const PackingSpec s5(65, 47, s5_s) [related]

const int s6_s[] [related]

Initial value:

 {50,42,37,35,33,29,27,25,24,19,18,
                           17,16,15,11,9,8,7,6,4,2,0}

Definition at line 64 of file packing.cc.

const PackingSpec s6(112, 112, s6_s) [related]

const int s7_s[] [related]

Initial value:

 {81,64,56,55,51,43,39,38,35,33,31,30,29,20,
                           18,16,14,9,8,5,4,3,2,1,0}

Definition at line 68 of file packing.cc.

const PackingSpec s7(175, 175, s7_s) [related]

const PackingSpec* specs[] = {&s0,&s1,&s2,&s3,&s4,&s5,&s6,&s7} [related]

Definition at line 72 of file packing.cc.

const unsigned int n_examples = sizeof(specs) / sizeof(PackingSpec*) [related]

Definition at line 73 of file packing.cc.


Member Data Documentation

const PackingSpec& Packing::s [protected]

Specification used.

Definition at line 84 of file packing.cc.

IntVarArray Packing::x [protected]

Array of x-coordinates of squares.

Definition at line 86 of file packing.cc.

IntVarArray Packing::y [protected]

Array of y-coordinates of squares.

Definition at line 88 of file packing.cc.


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