Class GoMokuSearchable<B extends GoMokuBoard>

    • Constructor Detail

      • GoMokuSearchable

        public GoMokuSearchable​(B board,
                                PlayerList players)
        Constructor
    • Method Detail

      • copy

        public GoMokuSearchable<B> copy()
        Returns:
        a copy of our current state so we can make moves and not worry about undoing them.
      • createPatterns

        protected Patterns createPatterns()
      • worth

        public int worth​(TwoPlayerMove lastMove,
                         com.barrybecker4.optimization.parameter.ParameterArray weights)
        Statically evaluate the board position from player1's point of view.
        Specified by:
        worth in interface Searchable<TwoPlayerMove,​B extends GoMokuBoard>
        Specified by:
        worth in class TwoPlayerSearchable<TwoPlayerMove,​B extends GoMokuBoard>
        Parameters:
        lastMove - the last move made
        weights - the polynomial weights to use in the polynomial evaluation function
        Returns:
        the lastMoves value modified by the value add of the new move. a large positive value means that the move is good from player1's viewpoint
      • generateMoves

        public MoveList<TwoPlayerMove> generateMoves​(TwoPlayerMove lastMove,
                                                     com.barrybecker4.optimization.parameter.ParameterArray weights)
        generate all possible next moves.
        Parameters:
        lastMove - the last move made if there was one. (null if first move of the game)
        weights - the polynomial weights to use in the polynomial evaluation function.
        Returns:
        list of possible next moves.
      • generateUrgentMoves

        public MoveList<TwoPlayerMove> generateUrgentMoves​(TwoPlayerMove lastMove,
                                                           com.barrybecker4.optimization.parameter.ParameterArray weights)
        Consider both our moves and opponent moves that result in wins. Opponent moves that result in a win should be blocked.
        Parameters:
        lastMove - the last move made
        weights - the polynomial weights to use in the polynomial evaluation function
        Returns:
        Set of moves the moves that result in a certain win or a certain loss.
      • getJeopardyWeight

        protected int getJeopardyWeight()