SportsLeague Class Reference
[Example scripts (models)]
Inherits Example.
Detailed Description
Example: Sports League SchedulingProb026: round robin tournaments from http://www.csplip.org
- There are
teams (
even).
- The season lasts
weeks.
- Each game between two different teams occurs exactly once.
- Every team plays one game in each week of the season.
- There are
periods and each week every period is scheduled for one game.
- No team plays more than twice in the same period over the course of the season.
Definition at line 59 of file sports-league.cc.
Public Member Functions | |
IntVar & | h (int p, int w) |
Access the home team in period p and week w. | |
IntVar & | a (int p, int w) |
Access the away team in period p and week w. | |
IntVar & | g (int p, int w) |
Access the game number associated with the game in period p and week w. | |
Play & | rrs (int p, int w) |
Access the entry in the round robin schedule for period p and week w. | |
int | gn (int h, int a) |
Compute game numbers. | |
void | init_rrs (void) |
Build a feasible schedule. | |
SportsLeague (const Options &op) | |
SportsLeague (bool share, SportsLeague &s) | |
virtual Space * | copy (bool share) |
Copying member function. | |
virtual void | print (void) |
Protected Member Functions | |
int | digit (int n) |
void | blank (int n) |
void | blankv (int n) |
void | blank_only (int n) |
Constructor & Destructor Documentation
|
Symmetrie breaking: we consider (h, a) and (a, h) as the same game and focus on the home game for h, i.e. (h, a) with h < a Constraint on each column: each team occurs exactly once. (you need two teams in order to form a match). Constraint on each row: no team appears more than twice (you do not want a team to play more than twice a week in the same slot the same time.) Definition at line 232 of file sports-league.cc. |
|
Definition at line 355 of file sports-league.cc. |
Member Function Documentation
|
Definition at line 84 of file sports-league.cc. |
|
Definition at line 95 of file sports-league.cc. |
|
Definition at line 102 of file sports-league.cc. |
|
Definition at line 109 of file sports-league.cc. |
|
Access the home team in period p and week w.
Definition at line 117 of file sports-league.cc. |
|
Access the away team in period p and week w.
Definition at line 122 of file sports-league.cc. |
|
Access the game number associated with the game in period p and week w.
Definition at line 130 of file sports-league.cc. |
|
Access the entry in the round robin schedule for period p and week w.
Definition at line 138 of file sports-league.cc. |
|
Compute game numbers.
Given the game Definition at line 151 of file sports-league.cc. |
|
Build a feasible schedule.
The games of the first week are fixed as: Definition at line 181 of file sports-league.cc. |
|
Copying member function. Must create a new object using the constructor for cloning. Implements Gecode::Space. Definition at line 366 of file sports-league.cc. |
|
Reimplemented from Example. Definition at line 370 of file sports-league.cc. |
The documentation for this class was generated from the following file:
- examples/sports-league.cc (Revision: 3517)