def main(): """ Run a tournament between two agents and print the resulting winrate for the first agent. """ interface1 = gtpinterface(TreeThreadingAgent(threads=5)) interface2 = gtpinterface(rave_mctsagent()) arguments = [10, 500, 1000, 7000] # lst = subsets_of_2(arguments) address = 'results/result.txt' with open(address, 'a') as f: f.write('TESTING THREADING_MCTSAGENT\n') f.close() i = 0 while i != len(arguments): interface2.RAVE_CONSTANT = arguments[i] result = tournament(interface1, interface2, game_number, num_rollouts, boardsize, opening_moves) with open(address, 'a') as file: file.write('Result of tournament %a \n' % i) file.write('For agent with RAVE_CONSTANT %a\n' % interface2.RAVE_CONSTANT) file.write('player 1 wins = %a games \n' % result[0]) file.write('player 2 wins = %a games \n' % result[1]) file.write("Total time : %a \n\n\n" % result[2]) file.close() i += 1
def main(): """ Run a tournament between two agents and print the resulting winrate for the first agent. """ interface1 = gtpinterface(mctsagent()) interface2 = gtpinterface(mctsagent()) print(str(tournament(interface1, interface2, 4, 2, 3, ['a1'])))
def main(): """ Run a tournament between two agents and print the resulting winrate for the first agent. """ interface1 = gtpinterface(mctsagent()) interface2 = gtpinterface(mctsagent()) print(str(tournament(interface1, interface2, game_number, move_time, boardsize, opening_moves)))
def main(): """ Main function, simply sends user input on to the gtp interface and prints responses. """ agent = mctsagent() interface = gtpinterface(agent) while True: command = input() success, response = interface.send_command(command) print(("= " if success else "? ") + response + '\n')
def main(): """ Main function, simply sends user input on to the gtp interface and prints responses. """ interface = gtpinterface("treeNet") while True: command = raw_input() success, response = interface.send_command(command) print "= " if success else "? ",response,"\n" sys.stdout.flush()
def main(): """ Main function, simply sends user input on to the gtp interface and prints responses. """ agent = mctsagent() interface = gtpinterface(agent) while True: command = input() success, response = interface.send_command(command) print(("= " if success else "? ")+response+'\n')
def main(): """ Main function, simply sends user input on to the gtp interface and prints responses. """ interface = gtpinterface("treeNet") while True: command = raw_input() success, response = interface.send_command(command) print "= " if success else "? ", response, "\n" sys.stdout.flush()