from Game import TicTacToe
from QLearning import Qlearning

game = TicTacToe(True)  #init game, true implies training
agent1 = Qlearning()  #learning agent 1
agent2 = Qlearning()  #learning agent 2

game.startTraining(agent1, agent2)  #train agents
game.train(250000)  #250,000 iterations

game.saveStates()  #save Qtable
Esempio n. 2
0
from Game import TicTacToe
from QLearning import  Qlearning
import sys

ites = []
assert len(sys.argv)-1==3
for i in range(1,4):
    ites.append(int(sys.argv[i]))
game = TicTacToe(True) #game instance, True means training
player1= Qlearning() #player1 learning agent
player2 =Qlearning() #player2 learning agent
game.startTraining(player1,player2)
game.train(ites[2],ites)
game.saveStates() 
Esempio n. 3
0
from Game import TicTacToe
from QLearning import  Qlearning

game = TicTacToe(True) #game instance, True means training
player1= Qlearning() #player1 learning agent
player2 =Qlearning() #player2 learning agent
game.startTraining(player1,player2) #start training
game.train(200000) #train for 200,000 iterations
game.saveStates()  #save Qtable