Generated on Mon Aug 25 11:35:48 2008 for Gecode by doxygen 1.5.6

Photo Class Reference
[Scripts for problems]

Inherits Example.

List of all members.


Detailed Description

Example: Placing people on a photo

A group of people wants to take a group photo. Each person can give preferences next to whom he or she wants to be placed on the photo. The problem to be solved is to find a placement that satisfies as many preferences as possible.

Definition at line 77 of file photo.cc.


Public Types

enum  { BRANCH_NONE, BRANCH_DEGREE }
 Branching to use for model. More...

Public Member Functions

 Photo (const SizeOptions &opt)
 Actual model.
 Photo (bool share, Photo &s)
 Constructor for cloning s.
virtual Spacecopy (bool share)
 Copy during cloning.
virtual void print (std::ostream &os)
 Print solution.
void constrain (Space *s)
 Add constraint for next better solution.

Protected Attributes

const PhotoSpecspec
 Photo specification.
IntVarArray pos
 Person's position on photo.
IntVar sat
 Number of satisfied preferences.

Member Enumeration Documentation

anonymous enum

Branching to use for model.

Enumerator:
BRANCH_NONE  Choose variables from left to right.
BRANCH_DEGREE  Choose variable with largest degree.

Definition at line 88 of file photo.cc.


Constructor & Destructor Documentation

Photo::Photo ( const SizeOptions opt  )  [inline]

Actual model.

Definition at line 93 of file photo.cc.

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

Constructor for cloning s.

Definition at line 123 of file photo.cc.


Member Function Documentation

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

Copy during cloning.

Implements Gecode::Space.

Definition at line 131 of file photo.cc.

virtual void Photo::print ( std::ostream &  os  )  [inline, virtual]

Print solution.

Reimplemented from Example.

Definition at line 137 of file photo.cc.

void Photo::constrain ( Space s  )  [inline]

Add constraint for next better solution.

Definition at line 144 of file photo.cc.


Member Data Documentation

const PhotoSpec& Photo::spec [protected]

Photo specification.

Definition at line 80 of file photo.cc.

IntVarArray Photo::pos [protected]

Person's position on photo.

Definition at line 82 of file photo.cc.

IntVar Photo::sat [protected]

Number of satisfied preferences.

Definition at line 84 of file photo.cc.


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