本文整理汇总了Python中solver.Solver.startSolver方法的典型用法代码示例。如果您正苦于以下问题:Python Solver.startSolver方法的具体用法?Python Solver.startSolver怎么用?Python Solver.startSolver使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类solver.Solver
的用法示例。
在下文中一共展示了Solver.startSolver方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Tk
# 需要导入模块: from solver import Solver [as 别名]
# 或者: from solver.Solver import startSolver [as 别名]
from visuals import GameWindow
from board import Board
from solver import Solver
from Tkinter import *
import random, sys, copy, time
root = Tk()
window = GameWindow(root)
random_res = []
for i in range(50):
board = Board()
window.update_view( board.generateState(board.grid) )
solver = Solver(board, window, root)
solver.startSolver("random")
random_res.append(int(2**board.bestTile))
print random_res
'''for i in range(1,50):
board = Board()
window.update_view( board.generateState(board.grid) )
solver = Solver(board, window, root, train_nr=i)
#modes: random, upleftdownright, partialAI, onestepahead
solver.startSolver("expectimax")'''
# TO PLAY THE GAME, UMCOMMENT THESE LINES
'''
while True:
window.update_view( board.generateState(board.grid) )
print "POINTS========> > > " + str(board.points) + " < < <========POINTS"