|
JSettlers v1.0.6 API Built ${date} |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsoc.robot.SOCRobotDM
Moved the routines that pick what to build next out of SOCRobotBrain. Didn't want to call this SOCRobotPlanner because it doesn't really plan, but you could think of it that way. DM = Decision Maker
Field Summary | |
protected float |
adversarialFactor
|
protected SOCRobotBrain |
brain
|
protected java.util.Stack |
buildingPlan
|
protected static int |
CITY_CHOICE
|
protected float |
devCardMultiplier
|
protected static java.text.DecimalFormat |
df1
|
protected float |
etaBonusFactor
|
static int |
FAST_STRATEGY
|
protected SOCPossibleCity |
favoriteCity
|
protected SOCPossibleRoad |
favoriteRoad
|
protected SOCPossibleSettlement |
favoriteSettlement
|
protected SOCGame |
game
|
protected java.util.Vector |
goodRoads
|
protected java.util.Vector |
goodSettlements
|
protected static int |
LA_CHOICE
|
protected float |
leaderAdversarialFactor
|
protected static int |
LR_CHOICE
|
protected int |
maxETA
|
protected int |
maxGameLength
|
protected static int |
ONE_OF_EACH
|
protected SOCPlayer |
ourPlayerData
|
protected SOCPlayerTracker |
ourPlayerTracker
|
protected java.util.HashMap |
playerTrackers
|
protected SOCPossibleCard |
possibleCard
|
protected static int |
SETTLEMENT_CHOICE
|
static int |
SMART_STRATEGY
used for describing strategies |
protected java.util.Vector |
threatenedRoads
|
protected java.util.Vector |
threatenedSettlements
|
protected float |
threatMultiplier
|
protected static int |
TWO_CITIES
|
protected static int |
TWO_SETTLEMENTS
used in planStuff |
protected static int |
WIN_LA
|
protected static int |
WIN_LR
|
Constructor Summary | |
SOCRobotDM(SOCRobotBrain br)
constructor |
|
SOCRobotDM(SOCRobotParameters params,
java.util.HashMap pt,
SOCPlayerTracker opt,
SOCPlayer opd,
java.util.Stack bp)
constructor this is if you don't want to use a brain |
Method Summary | |
protected float |
calcWGETABonus(java.util.HashMap trackersBefore,
java.util.HashMap trackersAfter)
calc the win game eta bonus |
float |
calcWGETABonusAux(int[] originalWGETAs,
java.util.HashMap trackersAfter,
java.util.Vector leaders)
calcWGETABonusAux |
protected void |
dumbFastGameStrategy(int[] buildingETAs)
dumbFastGameStrategy uses rules to determine what to build next |
SOCPossibleCard |
getDevCardScore(int cardETA,
int leadersCurrentWGETA)
calc dev card score |
float |
getETABonus(int eta,
int leadWGETA,
float bonus)
calc eta bonus |
SOCPossibleCity |
getFavoriteCity()
|
SOCPossibleRoad |
getFavoriteRoad()
|
SOCPossibleSettlement |
getFavoriteSettlement()
|
SOCPossibleCard |
getPossibleCard()
|
protected float |
getWinGameETABonus(SOCPossiblePiece posPiece)
add a bonus to the possible piece score based on the change in win game ETA |
protected float |
getWinGameETABonusForRoad(SOCPossibleRoad posRoad,
int roadETA,
int leadersCurrentWGETA,
java.util.HashMap playerTrackers)
add a bonus to the road score based on the change in win game ETA for this one road |
void |
planStuff(int strategy)
make some building plans |
protected void |
scorePossibleSettlements(int settlementETA,
int leadersCurrentWGETA)
score possible settlements for smartStrategy |
protected void |
scoreSettlementsForDumb(int settlementETA,
SOCBuildingSpeedEstimate ourBSE)
score all possible settlements by getting their speedup total calculate ETA by finding shortest path and then using a SOCBuildingSpeedEstimate to find the ETA |
protected void |
smartGameStrategy(int[] buildingETAs)
smart game strategy use WGETA to determine best move |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static final java.text.DecimalFormat df1
protected int maxGameLength
protected int maxETA
protected float etaBonusFactor
protected float adversarialFactor
protected float leaderAdversarialFactor
protected float devCardMultiplier
protected float threatMultiplier
protected static final int LA_CHOICE
protected static final int LR_CHOICE
protected static final int CITY_CHOICE
protected static final int SETTLEMENT_CHOICE
protected static final int TWO_SETTLEMENTS
protected static final int TWO_CITIES
protected static final int ONE_OF_EACH
protected static final int WIN_LA
protected static final int WIN_LR
public static final int SMART_STRATEGY
public static final int FAST_STRATEGY
protected SOCRobotBrain brain
protected java.util.HashMap playerTrackers
protected SOCPlayerTracker ourPlayerTracker
protected SOCPlayer ourPlayerData
protected java.util.Stack buildingPlan
protected SOCGame game
protected java.util.Vector threatenedRoads
protected java.util.Vector goodRoads
protected SOCPossibleRoad favoriteRoad
protected java.util.Vector threatenedSettlements
protected java.util.Vector goodSettlements
protected SOCPossibleSettlement favoriteSettlement
protected SOCPossibleCity favoriteCity
protected SOCPossibleCard possibleCard
Constructor Detail |
public SOCRobotDM(SOCRobotBrain br)
br
- the robot brainpublic SOCRobotDM(SOCRobotParameters params, java.util.HashMap pt, SOCPlayerTracker opt, SOCPlayer opd, java.util.Stack bp)
params
- the robot parameterspt
- the player trackersopt
- our player trackeropd
- our player databp
- our building planMethod Detail |
public SOCPossibleSettlement getFavoriteSettlement()
public SOCPossibleCity getFavoriteCity()
public SOCPossibleRoad getFavoriteRoad()
public SOCPossibleCard getPossibleCard()
public void planStuff(int strategy)
strategy
- an integer that determines which strategy is used (SMART_STRATEGY | FAST_STRATEGY)protected void dumbFastGameStrategy(int[] buildingETAs)
buildingETAs
- the etas for building somethingprotected void scoreSettlementsForDumb(int settlementETA, SOCBuildingSpeedEstimate ourBSE)
settlementETA
- eta for building a settlement from nowprotected void smartGameStrategy(int[] buildingETAs)
buildingETAs
- the etas for building somethingprotected void scorePossibleSettlements(int settlementETA, int leadersCurrentWGETA)
protected float getWinGameETABonus(SOCPossiblePiece posPiece)
posPiece
- the possible piece that we're scoringprotected float getWinGameETABonusForRoad(SOCPossibleRoad posRoad, int roadETA, int leadersCurrentWGETA, java.util.HashMap playerTrackers)
posRoad
- the possible piece that we're scoringroadETA
- the eta for the roadleadersCurrentWGETA
- the leaders current WGETAplayerTrackers
- the player trackers (passed in as an argument for figuring out road building plan)protected float calcWGETABonus(java.util.HashMap trackersBefore, java.util.HashMap trackersAfter)
trackersBefore
- list of player trackers before movetrackersAfter
- list of player trackers after movepublic float calcWGETABonusAux(int[] originalWGETAs, java.util.HashMap trackersAfter, java.util.Vector leaders)
originalWGETAs
- the original WGETAstrackersAfter
- the playerTrackers after the changeleaders
- a list of leaderspublic SOCPossibleCard getDevCardScore(int cardETA, int leadersCurrentWGETA)
public float getETABonus(int eta, int leadWGETA, float bonus)
leadWGETA
- the wgeta of the leadereta
- the building eta
|
JSettlers v1.0.6 API Built ${date} |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |