Skip to content
Snippets Groups Projects
Unverified Commit 3778777a authored by Gabriel Santamaria's avatar Gabriel Santamaria
Browse files

Updating statistics

parent f639dc6c
No related branches found
No related tags found
No related merge requests found
......@@ -50,8 +50,8 @@ def is_mcts(ply, num_simul):
# The ultimate goal is to find the perfect couple
# that will make MCTS win most of the time.
ucb = [UCB.ucb, UCB.ucb_tuned]
weights = np.arange(0.5, 10, 2)
levels = np.arange(8, 10, 1)
weights = np.arange(0.5, 10, 1)
levels = [10]
def game(ce, fucb, level, i):
......@@ -79,18 +79,26 @@ def game(ce, fucb, level, i):
while not rules.game_over(grid):
if ply == 1:
s = time.time()
action = player_one.get_action(grid, ply)
if is_mcts(ply, i):
ttime += time.time() - s
niter += 1
grid.move(action, ply)
try:
action = player_one.get_action(grid, ply)
if is_mcts(ply, i):
ttime += time.time() - s
niter += 1
grid.move(action, ply)
except RuntimeError:
print("Runtime error, retrying...")
continue
else:
s = time.time()
action = player_two.get_action(grid, ply)
if is_mcts(ply, i):
ttime += time.time() - s
niter += 1
grid.move(action, ply)
try:
action = player_two.get_action(grid, ply)
if is_mcts(ply, i):
ttime += time.time() - s
niter += 1
grid.move(action, ply)
except RuntimeError:
print("Runtime error, retrying...")
continue
ply = other(ply)
......
......@@ -23,7 +23,7 @@ from .rules import Rules, Dodo
sys.setrecursionlimit(10**6)
WORKERS_DIVISOR = 1
WORKERS_DIVISOR = 2
class Strategy:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment