Examples of GoGroup


Examples of com.barrybecker4.game.twoplayer.go.board.elements.group.GoGroup

        for ( int i = 1; i <= getBoard().getNumRows(); i++ )  {
           for ( int j = 1; j <= getBoard().getNumCols(); j++ ) {
               GoBoardPosition seed = (GoBoardPosition)getBoard().getPosition(i, j);
               if (seed.isOccupied() && !seed.isVisited()) {
                   GoBoardPositionList newGroup = nbrAnalyzer_.findGroupFromInitialPosition(seed, false);
                   GoGroup g = new GoGroup(newGroup);
                   groups.add(g);
               }
           }
        }
    }
View Full Code Here

Examples of com.barrybecker4.game.twoplayer.go.board.elements.group.GoGroup

        boolean firstString = true;
        IGoGroup group = null;
        for  (GoBoardPositionList stringList : strings) {
            IGoString string = new GoString( stringList, b );
            if ( firstString ) {
                group = new GoGroup( string );
                firstString = false;
            }
            else {
                group.addMember(string);
            }
View Full Code Here

Examples of com.barrybecker4.game.twoplayer.go.board.elements.group.GoGroup

        for ( int i = 1; i <= board_.getNumRows(); i++ )  {
            for ( int j = 1; j <= board_.getNumCols(); j++ ) {
                GoBoardPosition pos = (GoBoardPosition)board_.getPosition(i, j);
                if (pos.isOccupied() && !groups.containsPosition(pos)) {
                    // would this run faster if  second param was false?
                    groups.add(new GoGroup(findGroupFromInitialPosition(pos, true)));
                }
            }
        }
        return groups;
    }
View Full Code Here

Examples of com.barrybecker4.game.twoplayer.go.board.elements.group.GoGroup

        // the default if there is no weakest group.
        float relativeHealth = absoluteHealth;
        GoBoardPositionSet groupStones = group_.getStones();
        WeakestGroupFinder finder = new WeakestGroupFinder(board, analyzerMap_);
        GoGroup weakestGroup = finder.findWeakestGroup(groupStones);

        if (weakestGroup != null)  {
            double proportionWithEnemyNbrs = findProportionWithEnemyNbrs(groupStones);

            double diff = absoluteHealth + analyzerMap_.getAnalyzer(weakestGroup).getAbsoluteHealth();
View Full Code Here

Examples of com.barrybecker4.game.twoplayer.go.board.elements.group.GoGroup

        float side = isPlayer1? 1.0f : -1.0f;

        // initialize to strongest value, then anything will be weaker.
        double weakestHealth = -side;

        GoGroup weakestGroup = null;
        for (Object egroup : enemyNbrGroups) {
            GoGroup enemyGroup = (GoGroup)egroup;
            double h = analyzerMap.getAnalyzer(enemyGroup).getAbsoluteHealth();
            if ((side * h) > (side * weakestHealth)) {
                weakestHealth = h;
                weakestGroup = enemyGroup;
            }
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.