/* * APRENDIZAGEM */ public void normalLearning(int times) { for (int i = 0; i < times; i++) { if (roundNumber == 0) { //tabuleiro inicial jogo history.Add(new Board()); nextBoard = history[0]; } while (nextBoard != null) { nextBoard = learner.turnPlay(roundNumber++, history); if (nextBoard == null) { break; } history.Add(nextBoard); nextBoard = randomerPlayer.turnPlay(roundNumber++, history); if (nextBoard == null) { break; } history.Add(nextBoard); } roundNumber = 0; history.Clear(); if (i % 100 == 0) { Console.WriteLine(i); } } //escrever pesos no file writeToFile(TicTacToe.isLogWeights, TicTacToe.weights, algorithm.getW0().ToString()); writeToFile(TicTacToe.isLogWeights, TicTacToe.weights, algorithm.getW1().ToString()); writeToFile(TicTacToe.isLogWeights, TicTacToe.weights, algorithm.getW2().ToString()); writeToFile(TicTacToe.isLogWeights, TicTacToe.weights, algorithm.getW3().ToString()); writeToFile(TicTacToe.isLogWeights, TicTacToe.weights, algorithm.getW4().ToString()); writeToFile(TicTacToe.isLogWeights, TicTacToe.weights, algorithm.getW5().ToString()); writeToFile(TicTacToe.isLogWeights, TicTacToe.weights, algorithm.getW6().ToString()); }