|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.columbia.cs.coms4701.agent.environments.simple.SimpleEnvironmentObject
edu.columbia.cs.coms4701.agent.environments.pente.PenteRules
public class PenteRules
A description of the rules for the current game.
Begin by implementing your agent program for the "Standard" rules, but eventually you should be able to handle any combination of rules.
Field Summary | |
---|---|
static PenteRules |
CaptureOnly
Capture-only rules: * 19x19 board, * Can't win with stones-in-a-row (99 to win :P) * 10 captured stones (5 pairs) to win, * Black can play anywhere. |
static PenteRules |
Freestyle
Freestyle rules: * 19x19 board, * 5-in-a-row to win, * 10 captured stones (5 pairs) to win, * Black can play anywhere. |
static PenteRules |
Gomoku
Gomoku rules: * 19x19 board, * 5-in-a-row to win, * No captures, * Black must begin in center, but 2nd move isn't restricted |
static PenteRules |
MiniGame
The minigame: * 5x5 board, * 5-in-a-row to win, * No captures, * Black must begin in center, but 2nd move isn't restricted |
static PenteRules |
Quick
Quick rules: Standard rules, with a short time limit. |
static PenteRules |
Standard
Standard rules: * 19x19 board, * 5-in-a-row to win, * 10 captured stones (5 pairs) to win, * Black must begin in center, * Black's second move must be at least 2 spaces away from the center |
static PenteRules |
StandardSmallBoard
Standard rules, but on a smaller 13x13 board: * 13x13 board, * 5-in-a-row to win, * 10 captured stones (5 pairs) to win, * Black must begin in center, * Black's second move must be at least 2 spaces away from the center |
static PenteRules |
Tournament
Tournament rules: Standard rules, with a time limit. |
Fields inherited from class edu.columbia.cs.coms4701.agent.environments.simple.SimpleEnvironmentObject |
---|
changeSupport |
Constructor Summary | |
---|---|
PenteRules(int boardSize,
int stonesInARowToWin,
boolean capturesAllowed,
int stonesCapturedToWin,
boolean blackMustBeginInCenter,
boolean blackMustAvoidCenterOnSecondMove,
int requiredDistanceFromCenter)
Constructs a new set of PenteRules (ignoring the time limit options). |
|
PenteRules(int boardSize,
int stonesInARowToWin,
boolean capturesAllowed,
int stonesCapturedToWin,
boolean blackMustBeginInCenter,
boolean blackMustAvoidCenterOnSecondMove,
int requiredDistanceFromCenter,
boolean hasTimeLimit,
int softTimeLimitPerTurn,
int allowedViolationsOfSoftLimit,
int hardTimeLimitPerTurn)
Constructs a new set of PenteRules. |
Method Summary | |
---|---|
boolean |
blackMustAvoidCenterOnSecondMove()
Is the first player required to place their second stone some distance away from the center position? |
boolean |
blackMustBeginInCenter()
Is the first player required to begin by placing a stone in the center? |
boolean |
capturesAllowed()
Are captures allowed? |
int |
getAllowedViolationsOfSoftLimit()
|
int |
getBoardSize()
Returns the size of the board (which is always square) |
int |
getHardTimeLimitPerTurn()
|
int |
getRequiredDistanceFromCenter()
If the away-from-center rule applies, how far away |
int |
getSoftTimeLimitPerTurn()
|
int |
getStonesCapturedToWin()
Returns how many captures are needed to win. |
int |
getStonesInARowToWin()
Returns how many stones must be placed in a row to win. |
boolean |
isHasTimeLimit()
|
java.lang.String |
toString()
|
Methods inherited from class edu.columbia.cs.coms4701.agent.environments.simple.SimpleEnvironmentObject |
---|
addPropertyChangeListener, isAlive, removePropertyChangeListener, setAlive |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final PenteRules Standard
public static final PenteRules Tournament
public static final PenteRules Quick
public static final PenteRules StandardSmallBoard
public static final PenteRules MiniGame
public static final PenteRules Gomoku
public static final PenteRules Freestyle
public static final PenteRules CaptureOnly
Constructor Detail |
---|
public PenteRules(int boardSize, int stonesInARowToWin, boolean capturesAllowed, int stonesCapturedToWin, boolean blackMustBeginInCenter, boolean blackMustAvoidCenterOnSecondMove, int requiredDistanceFromCenter)
boardSize
- size of the boardstonesInARowToWin
- capturesAllowed
- stonesCapturedToWin
- blackMustBeginInCenter
- blackMustAvoidCenterOnSecondMove
- public PenteRules(int boardSize, int stonesInARowToWin, boolean capturesAllowed, int stonesCapturedToWin, boolean blackMustBeginInCenter, boolean blackMustAvoidCenterOnSecondMove, int requiredDistanceFromCenter, boolean hasTimeLimit, int softTimeLimitPerTurn, int allowedViolationsOfSoftLimit, int hardTimeLimitPerTurn)
boardSize
- size of the boardstonesInARowToWin
- capturesAllowed
- stonesCapturedToWin
- blackMustBeginInCenter
- blackMustAvoidCenterOnSecondMove
- hasTimeLimit
- - whether this game has a time limit per turnsoftTimeLimitPerTurn
- - the suggested max time per turn, in secondsallowedViolationsOfSoftLimit
- - how many times an agent may go over the soft limit; above this, the agent will forfeithardTimeLimitPerTurn
- - the absolute maximum time allowed per turn, in seconds. Any agent taking longer than this for a turn will forfeitMethod Detail |
---|
public boolean isHasTimeLimit()
public int getSoftTimeLimitPerTurn()
public int getAllowedViolationsOfSoftLimit()
public int getHardTimeLimitPerTurn()
public java.lang.String toString()
toString
in class SimpleEnvironmentObject
public boolean capturesAllowed()
If true, then the game may be won by obtaining 5 captured pairs.
public boolean blackMustBeginInCenter()
public boolean blackMustAvoidCenterOnSecondMove()
public int getRequiredDistanceFromCenter()
public int getStonesInARowToWin()
public int getBoardSize()
public int getStonesCapturedToWin()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |