com.anji.tournament
Class KRandomOppsTournament

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

public class KRandomOppsTournament
extends SimpleTournament
implements Configurable

Each subject plays at least k games against a random set of opponents. Does not count opponent results (i.e., the k opponents chosen for each contestant each round).

Author:
Philip Tucker

Nested Class Summary
 
Nested classes inherited from class com.anji.tournament.SimpleTournament
SimpleTournament.PlayerPair
 
Field Summary
 
Fields inherited from class com.anji.tournament.SimpleTournament
COMPONENT_GAME_KEY
 
Constructor Summary
KRandomOppsTournament()
          default ctor; object must be initialized with init()
KRandomOppsTournament(Game aGame, int aK, ScoringWeights aWeights, java.util.Random aRand)
          Note: this object overrides aMatch countOpponentResults to false
 
Method Summary
protected  void endTournament()
          end tournament
 int getMaxScore()
           
 int getMinScore()
           
protected  boolean hasNextPlayerPair()
           
 void init(Properties props)
           
protected  SimpleTournament.PlayerPair nextPlayerPair()
           
protected  void startTournament()
          restart tournament
 
Methods inherited from class com.anji.tournament.SimpleTournament
addContestant, clearContestants, getGame, getResults, getScoringWeights, playMatch, playTournament
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KRandomOppsTournament

public KRandomOppsTournament()
default ctor; object must be initialized with init()


KRandomOppsTournament

public KRandomOppsTournament(Game aGame,
                             int aK,
                             ScoringWeights aWeights,
                             java.util.Random aRand)
Note: this object overrides aMatch countOpponentResults to false

Parameters:
aGame -
aWeights -
aK - number of opponents for each subject
aRand - random number generator
Method Detail

init

public void init(Properties props)
          throws java.lang.Exception
Specified by:
init in interface Configurable
Overrides:
init in class SimpleTournament
Parameters:
props -
Throws:
java.lang.Exception
See Also:
Configurable.init(com.anji.util.Properties)

hasNextPlayerPair

protected boolean hasNextPlayerPair()
Specified by:
hasNextPlayerPair in class SimpleTournament
Returns:
boolean true if player pairs are stil available
See Also:
SimpleTournament.hasNextPlayerPair()

nextPlayerPair

protected SimpleTournament.PlayerPair nextPlayerPair()
Specified by:
nextPlayerPair in class SimpleTournament
Returns:
next pair of players
See Also:
SimpleTournament.nextPlayerPair()

startTournament

protected void startTournament()
Description copied from class: SimpleTournament
restart tournament

Specified by:
startTournament in class SimpleTournament
See Also:
SimpleTournament.startTournament()

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()

endTournament

protected void endTournament()
Description copied from class: SimpleTournament
end tournament

Specified by:
endTournament in class SimpleTournament
See Also:
SimpleTournament.endTournament()