self.table_q[state.position][1]=val elif(move==HAUT): self.table_q[state.position][2]=val elif(move==BAS): self.table_q[state.position][3]=val ''' Affiche la table des q ''' def showQTable(self): for l in self.table_q.values(): print l ''' Teste les différentes fonctions de la classe ''' if __name__ == "__main__": lab1 = Labyrinthe() lab1.loadMaze("./Exemples/lab1") learn = QLearning(lab1,10,1.5,-5,50,lab1.grille[0][1]) print "Exploration 1" # learn.exploration_pure(lab1.grille[0][1]) a = learn.exploration_exigente(lab1.grille[0][1]) print "Exploration 2" learn.exploration_exigente(a) print "Exploitation" b = learn.exploitation(lab1.grille[0][1]) learn.exploitation(b) lab1.show() # learn.showQTable()