Package b2p.state.bitboard.bitset
Class BitSetMove
- java.lang.Object
- 
- b2p.state.bitboard.bitset.BitSetMove
 
- 
 public class BitSetMove extends java.lang.ObjectBitSetMove 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 SummaryConstructors Constructor Description BitSetMove()
 - 
Method SummaryAll Methods Static Methods Concrete Methods Modifier and Type Method Description static intblackPawnsOutOfCamps(IState state)Returns an heuristic value depending on how many black pawns are out of campsstatic intdangerToKing(IState state)Returns an heuristic value depending on how many black pawns endangering the kingstatic intdiagonalBlackCouples(IState state)Returns an heuristic value depending on how many black pawns are in a diagonal position near to each otherstatic intfindTargetQuadrantForWhites(BitSetState state)Returns an heuristic value depending on which is the best quadrant to target for the white playerstatic B2PBitSetgetCapturedPawns(int from, int to, IState state)Returns aB2PBitSetwhich 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 intkingEscapesInOneMove(IState state)Returns a value depending on how many escapes the king has in a given state of the gamestatic booleankingHasMoreThanOneEscapePath(IState state)Returns a Boolean value depending on whether the king has more than one escape path in a given state of the gamestatic intkingMoves(IState state)Returns an heuristic value depending on how many moves does the king havestatic intkingStatus(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 intmovesNeededForKingEscape(IState state)Returns an heuristic value depending on how many moves the king needs to perform in order to escapestatic intpositionWeights(IState state)Returns an heuristic value considering the weight of every position in the boardstatic intwhiteCellInStrategicPosition(IState state)Returns an heuristic value depending on how many white pawns are in a strategic positionstatic intwhitePawnsAdjacentKing(IState state)Returns an heuristic value depending on how many white pawns are adjacent to king
 
- 
- 
- 
Method Detail- 
getMovesForPawnpublic 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 pawn
- state- current state of the game
- Returns:
- A List of possible moves
- See Also:
- IState
 
 - 
getCapturedPawnspublic static B2PBitSet getCapturedPawns(int from, int to, IState state) Returns aB2PBitSetwhich has set at 1 all captured pawns- Parameters:
- from- the position of the pawn starting cell
- to- the position of the pawn final cell
- state- the current state of the game
- Returns:
- a B2PBitSetwhich has set at 1 all captured pawns
- See Also:
- B2PBitSet
 
 - 
kingEscapesInOneMovepublic 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
 
 - 
kingHasMoreThanOneEscapePathpublic 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:
- trueif the king has more than one escape path
- See Also:
- BitSetPosition
 
 - 
positionWeightspublic 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
 
 - 
whiteCellInStrategicPositionpublic 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
 
 - 
kingStatuspublic 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
 
 - 
kingMovespublic 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
 
 - 
blackPawnsOutOfCampspublic static int blackPawnsOutOfCamps(IState state) Returns an heuristic value depending on how many black pawns are out of camps
 - 
diagonalBlackCouplespublic static int diagonalBlackCouples(IState state) Returns an heuristic value depending on how many black pawns are in a diagonal position near to each other
 - 
whitePawnsAdjacentKingpublic static int whitePawnsAdjacentKing(IState state) Returns an heuristic value depending on how many white pawns are adjacent to king
 - 
dangerToKingpublic 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
 
 - 
movesNeededForKingEscapepublic 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
 
 - 
findTargetQuadrantForWhitespublic 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
 
 
- 
 
-