def resets(): newNoise = Graphics.noise.get() newDiscount = Graphics.discount.get() newLivingReward = Graphics.livingreword.get() newAlpha = Graphics.alpha.get() newEpsilon = Graphics.epsilon.get() if newNoise == '': newNoise = 0.2 if newDiscount == '': newDiscount = 0.9 if newLivingReward == '': newLivingReward = 0.0 print('noise : ' + newNoise+ " discount: " + newDiscount + " livingreward : " + newLivingReward + " alpha : " + newAlpha + " epsilon : " + newEpsilon) if float(newAlpha) + float(newEpsilon) > 1.0: tkMessageBox.showinfo("Error","alpha + epsilon must smaller than 1.0 ! please change it ") else: for i in range(3): for j in range(4): if Graphics.QValues[i][j]!=0.0: Graphics.QV.delete(Graphics.QValues[i][j]) if Graphics.Arrows[i][j]!= 0.0: Graphics.QV.delete(Graphics.Arrows[i][j]) Graphics.iteration = 0 Graphics.QV.delete(Graphics.IterateCount) Graphics.gridworld = juzhen(noise=float(newNoise),discount=float(newDiscount),livingreward=float(newLivingReward),alpha=float(newAlpha),epsilon=float(newEpsilon))
def __init__(self,root): self.root = root Graphics.gridworld = juzhen()