def __init__(self, hidden_neurons, evolving_iterations, game_iterations, population_size): table = [yamb.Column(i) for i in range(6)] self.best_game = yamb.Yamb(table) self.game_iterations = game_iterations self.population_size = population_size self.iterations = evolving_iterations self.hidden_neurons = hidden_neurons self.population = [NeuralNetwork(self.hidden_neurons, game_iterations) for _ in range(population_size)]
def __init__(self, populationSize): self.__population_size = populationSize self.__networks = [] self.__parameter_list = (3, 8, 3) for i in range(self.__population_size): self.__networks.append(NeuralNetwork(self.__parameter_list)) self.__best_network = self.__networks[0] self.__generation = 1
def fill_population(self): while len(self.population) < self.population_size: self.population.append(NeuralNetwork(self.hidden_neurons, self.game_iterations))