soc.util
Class SOCRobotParameters

java.lang.Object
  extended by soc.util.SOCRobotParameters

public class SOCRobotParameters
extends java.lang.Object

This is a class to store a list of robot parameters. I put it in soc.util because the SOCServer and the SOCDBHelper needed to use it, but I didn't think they should have to include the soc.robot package.

Author:
Robert S. Thomas

Field Summary
protected  float adversarialFactor
           
protected  float devCardMultiplier
           
protected  float etaBonusFactor
           
protected  float leaderAdversarialFactor
           
protected  int maxETA
           
protected  int maxGameLength
           
protected  int strategyType
           
protected  float threatMultiplier
           
protected  int tradeFlag
           
 
Constructor Summary
SOCRobotParameters(int mgl, int me, float ebf, float af, float laf, float dcm, float tm, int st, int tf)
          constructor
SOCRobotParameters(SOCRobotParameters params)
          copy constructor
 
Method Summary
 SOCRobotParameters copyIfOptionChanged(java.util.Map<java.lang.String,SOCGameOption> gameOpts)
          Examine game options, and if any would change the robot parameters, make a copy of these parameters with the changed options.
 float getAdversarialFactor()
           
 float getDevCardMultiplier()
           
 float getETABonusFactor()
           
 float getLeaderAdversarialFactor()
           
 int getMaxETA()
           
 int getMaxGameLength()
           
 int getStrategyType()
           
 float getThreatMultiplier()
           
 int getTradeFlag()
          Does this robot make/accept trades with other players?
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

maxGameLength

protected int maxGameLength

maxETA

protected int maxETA

etaBonusFactor

protected float etaBonusFactor

adversarialFactor

protected float adversarialFactor

leaderAdversarialFactor

protected float leaderAdversarialFactor

devCardMultiplier

protected float devCardMultiplier

threatMultiplier

protected float threatMultiplier

strategyType

protected int strategyType

tradeFlag

protected int tradeFlag
Constructor Detail

SOCRobotParameters

public SOCRobotParameters(int mgl,
                          int me,
                          float ebf,
                          float af,
                          float laf,
                          float dcm,
                          float tm,
                          int st,
                          int tf)
constructor

Parameters:
mgl - the max game length
me - the max eta
ebf - the eta bonus factor
af - the adversarial factor
laf - the leader adversarial factor
dcm - the dev card multiplier
tm - the threat multiplier
st - the strategy type: FAST_STRATEGY or SMART_STRATEGY
tf - the trade flag: Does this robot make/accept trades with players? (1 or 0)

SOCRobotParameters

public SOCRobotParameters(SOCRobotParameters params)
copy constructor

Parameters:
params - the robot parameters
Method Detail

copyIfOptionChanged

public SOCRobotParameters copyIfOptionChanged(java.util.Map<java.lang.String,SOCGameOption> gameOpts)
Examine game options, and if any would change the robot parameters, make a copy of these parameters with the changed options. For example, game option "NT" means no trading, so if our getTradeFlag() is 1, copy and set it to 0.

Parameters:
gameOpts - The game's SOCGameOptions, or null
Returns:
This object, or a copy with updated parameters.

getMaxGameLength

public int getMaxGameLength()
Returns:
maxGameLength

getMaxETA

public int getMaxETA()
Returns:
maxETA

getETABonusFactor

public float getETABonusFactor()
Returns:
etaBonusFactor

getAdversarialFactor

public float getAdversarialFactor()
Returns:
adversarialFactor

getLeaderAdversarialFactor

public float getLeaderAdversarialFactor()
Returns:
leaderAdversarialFactor

getDevCardMultiplier

public float getDevCardMultiplier()
Returns:
devCardMultiplier

getThreatMultiplier

public float getThreatMultiplier()
Returns:
threatMultiplier

getStrategyType

public int getStrategyType()
Returns:
strategyType: FAST_STRATEGY or SOCRobotDM.SMART_STRATEGY

getTradeFlag

public int getTradeFlag()
Does this robot make/accept trades with other players?

Returns:
tradeFlag: 1 if accepts, 0 if not

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
Returns:
a human readable form of the data