Package b2p.state.bitboard.bitset
Class BitSetMove
- java.lang.Object
-
- b2p.state.bitboard.bitset.BitSetMove
-
public class BitSetMove extends java.lang.Object
BitSetMove Class provides methods for pieces' moves on the board as well as some functions used in the heuristics- Author:
- Alessandro Buldini, Alessandro Pomponio, Federico Zanini
-
-
Constructor Summary
Constructors Constructor Description BitSetMove()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static int
blackPawnsOutOfCamps(IState state)
Returns an heuristic value depending on how many black pawns are out of campsstatic int
dangerToKing(IState state)
Returns an heuristic value depending on how many black pawns endangering the kingstatic int
diagonalBlackCouples(IState state)
Returns an heuristic value depending on how many black pawns are in a diagonal position near to each otherstatic int
findTargetQuadrantForWhites(BitSetState state)
Returns an heuristic value depending on which is the best quadrant to target for the white playerstatic B2PBitSet
getCapturedPawns(int from, int to, IState state)
Returns aB2PBitSet
which has set at 1 all captured pawnsstatic java.util.List<IAction>
getMovesForPawn(int pawnPosition, IState state)
Returns a list of possible moves for a given pawn position and a given game statestatic int
kingEscapesInOneMove(IState state)
Returns a value depending on how many escapes the king has in a given state of the gamestatic boolean
kingHasMoreThanOneEscapePath(IState state)
Returns a Boolean value depending on whether the king has more than one escape path in a given state of the gamestatic int
kingMoves(IState state)
Returns an heuristic value depending on how many moves does the king havestatic int
kingStatus(IState state)
Returns an heuristic value depending on how many white and black pawns are near the king whether the king is in the throne, outside the throne or near the thronestatic int
movesNeededForKingEscape(IState state)
Returns an heuristic value depending on how many moves the king needs to perform in order to escapestatic int
positionWeights(IState state)
Returns an heuristic value considering the weight of every position in the boardstatic int
whiteCellInStrategicPosition(IState state)
Returns an heuristic value depending on how many white pawns are in a strategic positionstatic int
whitePawnsAdjacentKing(IState state)
Returns an heuristic value depending on how many white pawns are adjacent to king
-
-
-
Method Detail
-
getMovesForPawn
public static java.util.List<IAction> getMovesForPawn(int pawnPosition, IState state)
Returns a list of possible moves for a given pawn position and a given game state- Parameters:
pawnPosition
- position of the pawnstate
- current state of the game- Returns:
- A List of possible moves
- See Also:
IState
-
getCapturedPawns
public static B2PBitSet getCapturedPawns(int from, int to, IState state)
Returns aB2PBitSet
which has set at 1 all captured pawns- Parameters:
from
- the position of the pawn starting cellto
- the position of the pawn final cellstate
- the current state of the game- Returns:
- a
B2PBitSet
which has set at 1 all captured pawns - See Also:
B2PBitSet
-
kingEscapesInOneMove
public static int kingEscapesInOneMove(IState state)
Returns a value depending on how many escapes the king has in a given state of the game- Parameters:
state
- the current state of the game- Returns:
- an Integer representing an heuristic value
- See Also:
BitSetPosition
-
kingHasMoreThanOneEscapePath
public static boolean kingHasMoreThanOneEscapePath(IState state)
Returns a Boolean value depending on whether the king has more than one escape path in a given state of the game- Parameters:
state
- the current state of the game- Returns:
true
if the king has more than one escape path- See Also:
BitSetPosition
-
positionWeights
public static int positionWeights(IState state)
Returns an heuristic value considering the weight of every position in the board- Parameters:
state
- the current state of the game- Returns:
- an heuristic value
- See Also:
B2PBitSet
-
whiteCellInStrategicPosition
public static int whiteCellInStrategicPosition(IState state)
Returns an heuristic value depending on how many white pawns are in a strategic position- Parameters:
state
- the current state of the game- Returns:
- an heuristic value
- See Also:
whiteEarlyGameStrategicCells
-
kingStatus
public static int kingStatus(IState state)
Returns an heuristic value depending on how many white and black pawns are near the king whether the king is in the throne, outside the throne or near the throne- Parameters:
state
- the current state of the game- Returns:
- an heuristic value
- See Also:
B2PBitSet
-
kingMoves
public static int kingMoves(IState state)
Returns an heuristic value depending on how many moves does the king have- Parameters:
state
- the current state of the game- Returns:
- an heuristic value
- See Also:
getAvailableKingMoves
-
blackPawnsOutOfCamps
public static int blackPawnsOutOfCamps(IState state)
Returns an heuristic value depending on how many black pawns are out of camps
-
diagonalBlackCouples
public static int diagonalBlackCouples(IState state)
Returns an heuristic value depending on how many black pawns are in a diagonal position near to each other
-
whitePawnsAdjacentKing
public static int whitePawnsAdjacentKing(IState state)
Returns an heuristic value depending on how many white pawns are adjacent to king
-
dangerToKing
public static int dangerToKing(IState state)
Returns an heuristic value depending on how many black pawns endangering the king- Parameters:
state
- the current state of the game- Returns:
- an heuristic value
- See Also:
IState
,B2PBitSet
,castle
,specialKingCells
-
movesNeededForKingEscape
public static int movesNeededForKingEscape(IState state)
Returns an heuristic value depending on how many moves the king needs to perform in order to escape- Parameters:
state
- the current state of the game- Returns:
- an heuristic value
- See Also:
IState
,movesNeededForKingEscape_rec
-
findTargetQuadrantForWhites
public static int findTargetQuadrantForWhites(BitSetState state)
Returns an heuristic value depending on which is the best quadrant to target for the white player- Parameters:
state
- the current state of the game- Returns:
- an heuristic value
- See Also:
BitSetState
,BitSetStartingBoard
-
-