Generated on Tue Feb 11 2025 17:33:26 for Gecode by doxygen 1.12.0

Example: Golf tournament More...

Public Types

enum  { MODEL_PLAIN , MODEL_SYMMETRY }
 Model variants. More...
 
enum  { PROP_SET , PROP_INT , PROP_MIXED }
 Propagation. More...
 

Public Member Functions

 Golf (const GolfOptions &opt)
 Actual model.
 
virtual void print (std::ostream &os) const
 Print solution.
 
 Golf (Golf &s)
 Constructor for copying s.
 
virtual Spacecopy (void)
 Copy during cloning.
 
- Public Member Functions inherited from Gecode::Driver::ScriptBase< BaseSpace >
 ScriptBase (const Options &opt)
 Constructor.
 
 ScriptBase (ScriptBase &e)
 Constructor used for cloning.
 
virtual void compare (const Space &home, std::ostream &os) const
 Compare with s.
 

Public Attributes

int g
 Number of groups in a week.
 
int s
 Number of players in a group.
 
int w
 Number of weeks.
 
SetVarArray groups
 The sets representing the groups.
 

Related Symbols

(Note that these are not member symbols.)

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

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.
 
template<class Script , template< class > class Engine, class Options >
static void run (const Options &opt, Script *s=NULL)
 

Detailed Description

Example: Golf tournament

Schedule a golf tournament. This is problem 010 from csplib.

Note that "Modeling and Programming with Gecode" uses this example as a case study.

Definition at line 80 of file golf.cpp.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

Model variants.

Enumerator
MODEL_PLAIN 

A simple model.

MODEL_SYMMETRY 

Model with symmetry breaking.

Definition at line 83 of file golf.cpp.

◆ anonymous enum

anonymous enum

Propagation.

Enumerator
PROP_SET 

Propagation of pair play amount using set variables.

PROP_INT 

Propagation of pair play amount using int variables and distinct.

PROP_MIXED 

Propagation of pair play amount using both set and int variables.

Definition at line 88 of file golf.cpp.

Constructor & Destructor Documentation

◆ Golf() [1/2]

Golf::Golf ( const GolfOptions & opt)
inline

Actual model.

Definition at line 101 of file golf.cpp.

◆ Golf() [2/2]

Golf::Golf ( Golf & s)
inline

Constructor for copying s.

Definition at line 212 of file golf.cpp.

Member Function Documentation

◆ print()

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

Print solution.

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

Definition at line 202 of file golf.cpp.

◆ copy()

virtual Space * Golf::copy ( void )
inlinevirtual

Copy during cloning.

Definition at line 217 of file golf.cpp.

Friends And Related Symbol Documentation

◆ main()

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

Main-function.

Definition at line 226 of file golf.cpp.

Member Data Documentation

◆ g

int Golf::g

Number of groups in a week.

Definition at line 93 of file golf.cpp.

◆ s

int Golf::s

Number of players in a group.

Definition at line 94 of file golf.cpp.

◆ w

int Golf::w

Number of weeks.

Definition at line 95 of file golf.cpp.

◆ groups

SetVarArray Golf::groups

The sets representing the groups.

Definition at line 98 of file golf.cpp.


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