Esempio n. 1
0
gamma = args.gamma
interactive = args.interactive
mcts_sims = args.mcts_sims
mcts_const = args.mcts_const
mcts_tau = args.mcts_tau
ngames = args.ngames
printboard = args.printboard
save = args.save
save_dir = args.save_dir
save_file = args.save_file
selfplay = args.selfplay
"""
SOME INITS
"""
env_args = ((22, 10), app)
game = Tetris(*env_args)

if endless:
    ngames = 0

if selfplay:
    _agent_module = import_module('agents.' + agent_type)
    Agent = getattr(_agent_module, agent_type)
    agent = Agent(mcts_const,
                  mcts_sims,
                  tau=mcts_tau,
                  env=Tetris,
                  env_args=env_args,
                  n_actions=7)
    agent.update_root(game, ngames)
Esempio n. 2
0
gui = args.gui
interactive = args.interactive
mcts_sims = args.mcts_sims
mcts_const = args.mcts_const
mcts_tau = args.mcts_tau
ngames = args.ngames
printboard = args.printboard
print_board_to_file = args.print_board_to_file
save = args.save
save_dir = args.save_dir
save_file = args.save_file
"""
SOME INITS
"""
env_args = ((22, 10), app)
game = Tetris(*env_args)

if endless:
    ngames = 0

if agent_type:
    _agent_module = import_module('agents.' + agent_type)
    Agent = getattr(_agent_module, agent_type)
    agent = Agent(mcts_const,
                  mcts_sims,
                  tau=mcts_tau,
                  env=Tetris,
                  env_args=env_args,
                  n_actions=7)
    agent.update_root(game, ngames)
else: