com.anji.tournament
Class ScoringWeights

java.lang.Object
  extended bycom.anji.tournament.ScoringWeights
All Implemented Interfaces:
Configurable

public class ScoringWeights
extends java.lang.Object
implements Configurable

Author:
Philip Tucker

Constructor Summary
ScoringWeights()
          default constructor
ScoringWeights(int aWinValue, int aLossValue, int aTieValue, float aRawScoreValue)
           
 
Method Summary
 float calculateAverageScore(PlayerStats results)
           
 float calculateTotalScore(PlayerStats results)
           
 int getLossValue()
           
 float getRawScoreValue()
           
 int getTieValue()
           
 int getWinValue()
           
 void init(Properties props)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ScoringWeights

public ScoringWeights(int aWinValue,
                      int aLossValue,
                      int aTieValue,
                      float aRawScoreValue)
Parameters:
aWinValue - must be >= 0, >=aLossValue, and >=aTieValue
aLossValue - must be <=aTieValue and <=aWinValue
aTieValue - must be <=aWinValue and >=aLossValue
aRawScoreValue -

ScoringWeights

public ScoringWeights()
default constructor

Method Detail

init

public void init(Properties props)
Specified by:
init in interface Configurable
Parameters:
props - configuration parameters
See Also:
Configurable.init(com.anji.util.Properties)

getLossValue

public int getLossValue()
Returns:
loss weight

getTieValue

public int getTieValue()
Returns:
tie weight

getWinValue

public int getWinValue()
Returns:
win weight

calculateTotalScore

public float calculateTotalScore(PlayerStats results)
Parameters:
results -
Returns:
weighted score

calculateAverageScore

public float calculateAverageScore(PlayerStats results)
Parameters:
results -
Returns:
average weighted score per game

getRawScoreValue

public float getRawScoreValue()
Returns:
raw score weight

toString

public java.lang.String toString()
See Also:
Object.toString()