Examples of GoProfiler


Examples of com.barrybecker4.game.twoplayer.go.board.GoProfiler

     * Some friendly strings may have been split by the removal.
     * @param stone that was removed.
     * @param string that the stone belonged to.
     */
    private void updateStringsAfterRemove( GoBoardPosition stone, IGoString string ) {
        GoProfiler profiler = GoProfiler.getInstance();
        profiler.startUpdateStringsAfterRemove();

        // avoid error when calling from treeDlg
        if (string == null) return;

        splitStringsIfNeeded(stone, string);

        if ( GameContext.getDebugMode() > 1 ) {
            getAllGroups().confirmNoEmptyStrings();
            validator_.confirmStonesInValidGroups();
        }
        profiler.stopUpdateStringsAfterRemove();
    }
View Full Code Here

Examples of com.barrybecker4.game.twoplayer.go.board.GoProfiler

    /**
     * @return all reasonably good next moves with statically evaluated scores.
     */
    public final MoveList generateEvaluatedMoves(TwoPlayerMove lastMove, ParameterArray weights) {

        GoProfiler prof = GoProfiler.getInstance();
        prof.startGenerateMoves();

        MoveList moveList = generatePossibleMoves(lastMove);

        for (Move move : moveList)  {
            setMoveValue(weights, (GoMove)move);
        }
        boolean player1 = (lastMove == null) || !lastMove.isPlayer1();
        BestMoveFinder finder = new BestMoveFinder(searchable_.getSearchOptions().getBestMovesSearchOptions());
        moveList = finder.getBestMoves(player1, moveList);

        addPassingMoveIfNeeded(lastMove, moveList);

        prof.stopGenerateMoves();
        return moveList;
    }
View Full Code Here

Examples of com.barrybecker4.game.twoplayer.go.board.GoProfiler

    /**
     * Make the generated move, determine its value, set it into the move, and undo the move on the board.
     */
    private void setMoveValue(ParameterArray weights, GoMove m) {
        GoProfiler prof = GoProfiler.getInstance();
        prof.stopGenerateMoves();
        searchable_.makeInternalMove( m );

        m.setValue(searchable_.worth(m, weights));

        // now revert the board
        searchable_.undoInternalMove( m );
        prof.startGenerateMoves();
    }
View Full Code Here

Examples of com.barrybecker4.game.twoplayer.go.board.GoProfiler

     */
    public float updateTerritory(boolean isEndOfGame) {

        clearScores();

        GoProfiler prof = GoProfiler.getInstance();
        prof.startUpdateTerritory();
        analyzerMap_.clear()/// need?

        float delta = calcAbsoluteHealth();
        if (GoController.USE_RELATIVE_GROUP_SCORING)  {
            delta = calcRelativeHealth(prof, delta);
        }
        prof.startUpdateEmpty();
        if (isEndOfGame) {
            EmptyRegionUpdater emptyUpdater = new EmptyRegionUpdater(board_,  analyzerMap_);
            delta += emptyUpdater.updateEmptyRegions();
        }
        prof.stopUpdateEmpty();

        prof.stopUpdateTerritory();
        territoryDelta_ = delta;

        return delta;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.