Generated on Sat Feb 7 2015 02:01:38 for Gecode by doxygen 1.8.9.1
Photo Class Reference

Example: Placing people on a photo More...

Public Types

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

Public Member Functions

 Photo (const SizeOptions &opt)
 Actual model. More...
 
 Photo (bool share, Photo &s)
 Constructor for cloning s. More...
 
virtual Spacecopy (bool share)
 Copy during cloning. More...
 
virtual void print (std::ostream &os) const
 Print solution. More...
 
virtual IntVar cost (void) const
 Return solution cost. More...
 
- Public Member Functions inherited from Gecode::Driver::ScriptBase< BaseSpace >
 ScriptBase (void)
 Default constructor. More...
 
 ScriptBase (bool share, ScriptBase &e)
 Constructor used for cloning. More...
 
virtual void compare (const Space &, std::ostream &os) const
 Compare with s. More...
 

Protected Attributes

const PhotoSpecspec
 Photo specification. More...
 
IntVarArray pos
 Person's position on photo. More...
 
IntVar violations
 Number of violated preferences. More...
 

Related Functions

(Note that these are not member functions.)

int main (int argc, char *argv[])
 Main-function. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from Gecode::Driver::ScriptBase< BaseSpace >
static std::ostream & select_ostream (const char *name, std::ofstream &ofs)
 Choose output stream according to name. More...
 
template<class Script , template< class > class Engine, class Options >
static void run (const Options &opt, Script *s=NULL)
 

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 violates as few preferences as possible.

Definition at line 80 of file photo.cpp.

Constructor & Destructor Documentation

Photo::Photo ( const SizeOptions opt)
inline

Actual model.

Definition at line 96 of file photo.cpp.

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

Constructor for cloning s.

Definition at line 124 of file photo.cpp.

Member Function Documentation

virtual Space* Photo::copy ( bool  share)
inlinevirtual

Copy during cloning.

Definition at line 131 of file photo.cpp.

virtual void Photo::print ( std::ostream &  os) const
inlinevirtual

Print solution.

Reimplemented from Gecode::Driver::ScriptBase< BaseSpace >.

Definition at line 136 of file photo.cpp.

virtual IntVar Photo::cost ( void  ) const
inlinevirtual

Return solution cost.

Definition at line 141 of file photo.cpp.

Friends And Related Function Documentation

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

Main-function.

Definition at line 150 of file photo.cpp.

Member Data Documentation

const PhotoSpec& Photo::spec
protected

Photo specification.

Definition at line 83 of file photo.cpp.

IntVarArray Photo::pos
protected

Person's position on photo.

Definition at line 85 of file photo.cpp.

IntVar Photo::violations
protected

Number of violated preferences.

Definition at line 87 of file photo.cpp.


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