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. | |
Photo (bool share, Photo &s) | |
Constructor for cloning s. | |
virtual Space * | copy (bool share) |
Copy during cloning. | |
virtual void | print (std::ostream &os) const |
Print solution. | |
virtual IntVar | cost (void) const |
Return solution cost. | |
Protected Attributes | |
const PhotoSpec & | spec |
Photo specification. | |
IntVarArray | pos |
Person's position on photo. | |
IntVar | violations |
Number of violated preferences. | |
Related Functions | |
(Note that these are not member functions.) | |
int | main (int argc, char *argv[]) |
Main-function. |
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.
anonymous enum |
Photo::Photo | ( | const SizeOptions & | opt | ) | [inline] |
Photo::Photo | ( | bool | share, |
Photo & | s | ||
) | [inline] |
virtual Space* Photo::copy | ( | bool | share | ) | [inline, virtual] |
virtual void Photo::print | ( | std::ostream & | os | ) | const [inline, virtual] |
Print solution.
Reimplemented from Gecode::Driver::ScriptBase.
virtual IntVar Photo::cost | ( | void | ) | const [inline, virtual] |
int main | ( | int | argc, |
char * | argv[] | ||
) | [related] |
const PhotoSpec& Photo::spec [protected] |
IntVarArray Photo::pos [protected] |
IntVar Photo::violations [protected] |