Generated on Thu Aug 3 2017 01:28:56 for Gecode by doxygen 1.8.13
Photo Class Reference

Example: Placing people on a photo More...

Public Types

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

Public Member Functions

 Photo (const SizeOptions &opt)
 Actual model. More...
 
bool slave (const MetaInfo &mi)
 Slave function for restarts. More...
 
 Photo (bool share, Photo &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...
 
virtual IntVar cost (void) const
 Return solution cost. More...
 
- Public Member Functions inherited from Gecode::Driver::ScriptBase< BaseSpace >
 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 PhotoSpec & spec
 Photo specification. More...
 
IntVarArray pos
 Person's position on photo. More...
 
IntVar violations
 Number of violated preferences. More...
 
Rnd rnd
 Random number generator for LNS. More...
 
double p
 Relaxation probability. 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 *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)
 

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 81 of file photo.cpp.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

Branching to use for model.

Enumerator
BRANCH_NONE 

Choose variables from left to right.

BRANCH_DEGREE 

Choose variable with largest degree.

BRANCH_AFC_SIZE 

Choose variable with largest afc over size.

Definition at line 95 of file photo.cpp.

Constructor & Destructor Documentation

◆ Photo() [1/2]

Photo::Photo ( const SizeOptions &  opt)
inline

Actual model.

Definition at line 101 of file photo.cpp.

◆ Photo() [2/2]

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

Constructor for cloning s.

Definition at line 147 of file photo.cpp.

Member Function Documentation

◆ slave()

bool Photo::slave ( const MetaInfo &  mi)
inline

Slave function for restarts.

Definition at line 136 of file photo.cpp.

◆ copy()

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

Copy during cloning.

Definition at line 154 of file photo.cpp.

◆ print()

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

Print solution.

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

Definition at line 159 of file photo.cpp.

◆ cost()

virtual IntVar Photo::cost ( void  ) const
inlinevirtual

Return solution cost.

Definition at line 164 of file photo.cpp.

Friends And Related Function Documentation

◆ main()

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

Main-function.

Definition at line 173 of file photo.cpp.

Member Data Documentation

◆ spec

const PhotoSpec& Photo::spec
protected

Photo specification.

Definition at line 84 of file photo.cpp.

◆ pos

IntVarArray Photo::pos
protected

Person's position on photo.

Definition at line 86 of file photo.cpp.

◆ violations

IntVar Photo::violations
protected

Number of violated preferences.

Definition at line 88 of file photo.cpp.

◆ rnd

Rnd Photo::rnd
protected

Random number generator for LNS.

Definition at line 90 of file photo.cpp.

◆ p

double Photo::p
protected

Relaxation probability.

Definition at line 92 of file photo.cpp.


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