コード例 #1
0
    def astar(self, heuristic_val):
        #print "In dfs() of Play Class"

        #root node of type GameTree
        root = GameTree(self.startBoard)

        #Expand Boards Based On The The Heuristics
        possible_boards = root.getGameBoard().possibleBoards()

        #print "Possible Board Values in Play Class::",possible_boards;
        for nextBoard in possible_boards:
            nextNode = GameTree(nextBoard)
            #print "NextBoard Value in dfs() of Play Class::",nextBoard;
            if (self.play(nextBoard, nextNode)):
                root.addChild(nextNode)
コード例 #2
0
    def astar(self,heuristic_val):
            #print "In dfs() of Play Class"

        #root node of type GameTree
        root=GameTree(self.startBoard)

        #Expand Boards Based On The The Heuristics
        possible_boards=root.getGameBoard().possibleBoards();

        #print "Possible Board Values in Play Class::",possible_boards;
        for nextBoard in possible_boards:
            nextNode=GameTree(nextBoard);
            #print "NextBoard Value in dfs() of Play Class::",nextBoard;
            if(self.play(nextBoard,nextNode)):
                root.addChild(nextNode);
コード例 #3
0
    def dfs(self):
        #print "In dfs() of Play Class"

        #root node of type GameTree
        root = GameTree(self.startBoard)

        #
        possible_boards = root.getGameBoard().possibleBoards()

        #print "Possible Board Values in Play Class::",possible_boards;
        for nextBoard in possible_boards:
            nextNode = GameTree(nextBoard)
            #print "NextBoard Value in dfs() of Play Class::",nextBoard;
            if (self.play(nextBoard, nextNode)):
                root.addChild(nextNode)
コード例 #4
0
    def dfs(self):
        #print "In dfs() of Play Class"

        #root node of type GameTree
        root=GameTree(self.startBoard)

        #
        possible_boards=root.getGameBoard().possibleBoards();

        #print "Possible Board Values in Play Class::",possible_boards;
        for nextBoard in possible_boards:
            nextNode=GameTree(nextBoard);
            #print "NextBoard Value in dfs() of Play Class::",nextBoard;
            if(self.play(nextBoard,nextNode)):
                root.addChild(nextNode);