com.anji.tournament
Class DoubleEliminationTournament

java.lang.Object
  extended bycom.anji.tournament.DoubleEliminationTournament
All Implemented Interfaces:
Configurable, Tournament

public class DoubleEliminationTournament
extends java.lang.Object
implements Tournament, Configurable

Standard double elimination tournament, except players are re-seeded after every round. Also, in final round if losers bracket champ beats winners bracket champ, another game is played to determine champ.

Author:
Philip Tucker

Constructor Summary
DoubleEliminationTournament()
          default ctor; init() should be called before using this object
DoubleEliminationTournament(Game aGame, ScoringWeights aWeights, java.util.Random aRand)
          ctor Note: this object overrides aMatch countOpponentResults to true
 
Method Summary
 void addContestant(Player aContestant)
           
 void clearContestants()
          remove all contestants added via addContestant()
 int getMaxEliminationRounds()
          This isn't precise, but should be greater than or equal to the number of rounds in which players are eliminated from the lsoers bracket.
 int getMaxRounds()
          This isn't precise, but should be greater than or equal to the number of rounds.
 int getMaxScore()
           
 int getMinScore()
           
 void init(Properties props)
          Note: this object overrides aMatch countOpponentResults to true
 java.util.List playTournament()
          Play full tournament.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DoubleEliminationTournament

public DoubleEliminationTournament()
default ctor; init() should be called before using this object


DoubleEliminationTournament

public DoubleEliminationTournament(Game aGame,
                                   ScoringWeights aWeights,
                                   java.util.Random aRand)
ctor Note: this object overrides aMatch countOpponentResults to true

Parameters:
aGame -
aWeights -
aRand -
Method Detail

clearContestants

public void clearContestants()
Description copied from interface: Tournament
remove all contestants added via addContestant()

Specified by:
clearContestants in interface Tournament
See Also:
Tournament.clearContestants()

addContestant

public void addContestant(Player aContestant)
Specified by:
addContestant in interface Tournament
Parameters:
aContestant - Player to be added.
See Also:
Tournament.addContestant(com.anji.tournament.Player)

playTournament

public java.util.List playTournament()
Description copied from interface: Tournament
Play full tournament.

Specified by:
playTournament in interface Tournament
Returns:
List contains TournamentPlayerResults objects, sorted in descending order of score
See Also:
Tournament.playTournament()

getMaxRounds

public int getMaxRounds()
This isn't precise, but should be greater than or equal to the number of rounds.

Returns:
number of rounds in tournament; the extra game played at the end if the winners bracket champ loses to the losers bracket champ is not considered a separate round

getMaxEliminationRounds

public int getMaxEliminationRounds()
This isn't precise, but should be greater than or equal to the number of rounds in which players are eliminated from the lsoers bracket.

Returns:
number of elimination rounds in tournament

getMaxScore

public int getMaxScore()
Specified by:
getMaxScore in interface Tournament
Returns:
maximum possible score a contestant can achieve in this tournament; this value may change as contestants are added; refers to TournamentPlayerResults.getTournamentScore() not TournamentPlayerResults.getScore()
See Also:
Tournament.getMaxScore()

getMinScore

public int getMinScore()
Specified by:
getMinScore in interface Tournament
Returns:
minimum possible score a contestant can achieve in this tournament; this value may change as contestants are added; refers to TournamentPlayerResults.getTournamentScore() not TournamentPlayerResults.getScore()
See Also:
Tournament.getMinScore()

init

public void init(Properties props)
          throws java.lang.Exception
Note: this object overrides aMatch countOpponentResults to true

Specified by:
init in interface Configurable
Parameters:
props - configuration parameters
Throws:
java.lang.Exception
See Also:
Configurable.init(com.anji.util.Properties)