Exemplo n.º 1
0
	def __goNextGen(self):
		"""
		Evolve the population one generation, clear the scene and generate it again
		in other random positions
		"""
		if self.bestGenomeScore < Panda.getBestPanda().carrotsEaten:
			self.bestGenomeScore = Panda.getBestPanda().carrotsEaten
			self.bestGenomeGenes = Panda.getBestPanda().brainWeights

		self.actualFrameNumber = 0
		self.ga.step()

		Spike.clearNormalSpikes()
		Panda.clearPandas(self)
		Carrot.clearCarrots(self)

		self.__generateSpikes()
		self.__generatePandas()
		self.__generateCarrots()