Exemplo n.º 1
0
 def init_tree(self):
     self.root0 = Node()
     self.root = self.root0
     self.root.N = 1
     self.s = egn.Game_state()
     self.hist = set()
     self.expand(self.root, self.s)
     self.get_nnet_output(self.s, self.root)
Exemplo n.º 2
0
    def generate_sons(self):
        temp_gameState = shogi_engine.Game_state()
        for j in self.moveHistory:
            temp_gameState.update(j)
        self.moves = temp_gameState.legal_moves
        cutDrops(self.moves)

        for i in self.moves:
            copyTemp_gameState = copy.deepcopy(
                temp_gameState
            )  #We have to make this weird roundabout instead of copying gameState because tkinter doesn't allow us to deepcopy anything it uses for some reason
            copyTemp_gameState.update(i)
            self.sons.append((Node(temp_gameState,
                                   shogi_engine.other_side(self.aiSide),
                                   self.depth + 1, self.moveHistory + [i])))
        quickSortValue(self.sons, 0, len(self.sons) - 1)
Exemplo n.º 3
0
 def __init__(self):
     self.game = egn.Game_state()
Exemplo n.º 4
0
 def __init__(self, AI):
     self.state = egn.Game_state()
     self.AI = AI
Exemplo n.º 5
0
 def update(self, nnet):
     self.ai.nnet = nnet
     self.ai.root = self.ai.root0
     self.s = egn.Game_state()