Class RelativeTerritoryPlayer
- java.lang.Object
-
- org.swtpra1.AIPlayer
-
- org.swtpra1.relativeterritoryplayer.RelativeTerritoryPlayer
-
@Deprecated public class RelativeTerritoryPlayer extends AIPlayer
Deprecated.Only used as benchmark baselineThe class which represents the minimax algorithm.
-
-
Field Summary
-
Fields inherited from class org.swtpra1.AIPlayer
BUFFER_TIME, DEFAULT_MAX_TURN_TIME
-
-
Constructor Summary
Constructors Constructor Description RelativeTerritoryPlayer()
Deprecated.RelativeTerritoryPlayer which contains a game object and his player id.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Turn
calculateTurn(int gameId, Board board, int playerId, Turn enemyTurn)
Deprecated.Calculate the best turn a player can make.Turn
calculateTurn(int gameId, Board board, int playerId, Turn enemyTurn, long maxTurnTime)
Deprecated.Calculates best turn in the players' view within a given timelimit.void
generateTree(int depth, MinimaxNode root, int playerId)
Deprecated.Generate the tree of turns and boards until the depth is reached.-
Methods inherited from class org.swtpra1.AIPlayer
generateQueensMoves, getAllPossibleTurns, newGame
-
-
-
-
Method Detail
-
generateTree
public void generateTree(int depth, MinimaxNode root, int playerId)
Deprecated.Generate the tree of turns and boards until the depth is reached.- Parameters:
depth
- The depth of the tree.root
- The root node, the board we get.playerId
- Used for getting all possible turns of player with playerId
-
calculateTurn
public Turn calculateTurn(int gameId, Board board, int playerId, Turn enemyTurn)
Deprecated.Calculate the best turn a player can make. First, it generates the tree of turns and boards, then minimax-algorithm is called.- Specified by:
calculateTurn
in classAIPlayer
- Parameters:
gameId
- the id of the game that is being playedboard
- the current board stateplayerId
- our player idenemyTurn
- the turn played by the enemy- Returns:
- The best turn to make.
-
calculateTurn
public Turn calculateTurn(int gameId, Board board, int playerId, Turn enemyTurn, long maxTurnTime)
Deprecated.Description copied from class:AIPlayer
Calculates best turn in the players' view within a given timelimit.- Specified by:
calculateTurn
in classAIPlayer
- Parameters:
gameId
- the id of the game that is being playedboard
- the current board stateplayerId
- our player idenemyTurn
- the turn played by the enemymaxTurnTime
- the time we are given to calculate the turn in ms- Returns:
- best possible turn
-
-