예제 #1
0
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
예제 #2
0
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'])))
예제 #3
0
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)))
예제 #4
0
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'])))
예제 #5
0
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')
예제 #6
0
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()
예제 #7
0
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')
예제 #8
0
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()