Definition: Lane Assignments defines which teams bowl on which lanes during a competition.  Normally the sanctioning body will have a default lane assignment schedule, but some leagues may want to change it.  A good lane assignment schedule will assure each team bowls on each lane and against every other team during a period of competitions of 1 less than the number of teams in the league.  In other words, if the league has 12 teams, then using the 12 lanes to be used in the competitions, over 11 competitions, team 1 will bowl on all but one lane once, and compete against every other team once.  If the number of competitions is greater than this, then the same requirement exists for future competitions, but the assignments from the first set cannot be repeated.  That is, if during the first set, team 1 was on lane three and team 5 was on lane four then that situation cannot be repeated.  When team 1 bowls team 5, team 1 cannot be on lane three and team 5 on lane four.  They can be reversed, so team 1 is on lane four and team 5 is on lane three, or these teams can bowl each other on different lanes than three and four.

Issue: It is possible for the number of teams to change during a season, so this object must be capable of revising the lane assignments table at any point during the season.

Variables:  Variables here

  Modifier Class Name Value
    Integer serializableVersionUID 1234567

Characteristics:

  Tic name object
Lanes List<Team> by lane
Contest Number Integer

Requirements:

 
  • Ticable
  • HasID, but might not be used.
  • Serializable
  • Comparable and Comparator
  • Observable
  • new, to create a new instance using Tic default values.
  • RecordIO

Required Methods:

 
  • A no argument constructor.
  • Setters and getters for the characteristics.
  • The compare(Object, Object), compareTo(Object), and equals(Object) methods. (Comparable and Comparator)
  • Save() and Load() methods for saving/loading to a delimited file. (RecordIO)
  • Get a specific object using the ID.  The object may be in memory or need to be retrieved from a data store (file). (HasID)
  • A reset() method if the number of competitions or the number of teams changes.
  • Team getOpponent(Team team, int contestNo) return the Team which is the opponent to the input Team for the given Contest number.
  • Int onLane(Team team, int contestNo) return the lane where input team is bowling for the given contest number.