|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object soc.robot.SOCPossiblePiece soc.robot.SOCPossibleSettlement
public class SOCPossibleSettlement
This is a possible settlement that we can build
Field Summary | |
---|---|
protected java.util.Vector<SOCPossibleSettlement> |
conflicts
|
protected java.util.Vector<SOCPossibleRoad> |
necessaryRoads
|
protected int |
numberOfNecessaryRoads
|
protected java.util.Stack<SOCPossibleRoad> |
roadPath
|
protected int[] |
speedup
Speedup per building type. |
Fields inherited from class soc.robot.SOCPossiblePiece |
---|
biggestThreats, CARD, CITY, coord, eta, hasBeenExpanded, MAXPLUSONE, MIN, PICK_SPECIAL, pieceType, player, ROAD, score, SETTLEMENT, SHIP, threats, threatUpdatedFlag, updated |
Constructor Summary | |
---|---|
SOCPossibleSettlement(SOCPlayer pl,
int co,
java.util.Vector<SOCPossibleRoad> nr)
constructor |
|
SOCPossibleSettlement(SOCPossibleSettlement ps)
copy constructor Note: This will not copy vectors, only make empty ones |
Method Summary | |
---|---|
void |
addConflict(SOCPossibleSettlement s)
add a conflicting settlement |
void |
addNecessaryRoad(SOCPossibleRoad rd)
add a possible road to the list of necessary roads |
java.util.Vector<SOCPossibleSettlement> |
getConflicts()
|
java.util.Vector<SOCPossibleRoad> |
getNecessaryRoads()
Get this possible settlement's list of necessary roads, from constructor and/or addNecessaryRoad(SOCPossibleRoad) . |
int |
getNumberOfNecessaryRoads()
|
(package private) java.util.Stack<SOCPossibleRoad> |
getRoadPath()
Get the shortest road path to this settlement; some bots don't use this. |
int[] |
getSpeedup()
|
int |
getSpeedupTotal()
Get the total speedup from this settlement. |
void |
removeConflict(SOCPossibleSettlement s)
remove a conflicting settlement |
void |
setNumberOfNecessaryRoads(int num)
set the minimum number of necessary roads |
(package private) void |
setRoadPath(java.util.Stack<SOCPossibleRoad> path)
Shortest road/ship path to this settlement. |
void |
updateSpeedup()
update the speedup that this settlement gives. |
Methods inherited from class soc.robot.SOCPossiblePiece |
---|
addBiggestThreat, addThreat, addToScore, clearBiggestThreats, clearThreats, clearUpdateFlag, getBiggestThreats, getCoordinates, getETA, getPlayer, getResourcesToBuild, getScore, getThreats, getType, hasBeenExpanded, isETAUpdated, isThreatUpdated, resetExpandedFlag, resetScore, setETA, setExpandedFlag, subtractFromScore, threatUpdated, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected java.util.Vector<SOCPossibleRoad> necessaryRoads
protected java.util.Vector<SOCPossibleSettlement> conflicts
protected int[] speedup
SOCBuildingSpeedEstimate.MIN
to SOCBuildingSpeedEstimate.MAXPLUSONE
.
protected int numberOfNecessaryRoads
protected java.util.Stack<SOCPossibleRoad> roadPath
Constructor Detail |
---|
public SOCPossibleSettlement(SOCPlayer pl, int co, java.util.Vector<SOCPossibleRoad> nr)
pl
- the ownerco
- coordinates;nr
- necessaryRoads, or null
to create a new empty Vector herepublic SOCPossibleSettlement(SOCPossibleSettlement ps)
ps
- the possible settlement to copyMethod Detail |
---|
java.util.Stack<SOCPossibleRoad> getRoadPath()
setRoadPath(Stack)
for details.
void setRoadPath(java.util.Stack<SOCPossibleRoad> path)
getNecessaryRoads()
by
SOCRobotDM.scoreSettlementsForDumb(int, SOCBuildingSpeedEstimate)
.
The bots with SOCRobotDM.SMART_STRATEGY
won't calculate this;
instead, they pick roads/ships with 0 getNecessaryRoads()
,
and iteratively simulate building other things after picking such a road.
path
- a stack containing the shortest road path to this settlementpublic java.util.Vector<SOCPossibleRoad> getNecessaryRoads()
addNecessaryRoad(SOCPossibleRoad)
.
public int getNumberOfNecessaryRoads()
public void setNumberOfNecessaryRoads(int num)
num
- the minimum number of necessary roadspublic void updateSpeedup()
public java.util.Vector<SOCPossibleSettlement> getConflicts()
public void addNecessaryRoad(SOCPossibleRoad rd)
rd
- the roadpublic void addConflict(SOCPossibleSettlement s)
s
- the settlementpublic void removeConflict(SOCPossibleSettlement s)
s
- the settlementpublic int[] getSpeedup()
public int getSpeedupTotal()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |