def optimalWeightFinder(self): i = 1 while True: W = self.optimization() # optimize to find new weights in the list of policies print ("weights ::", W ) print ("the distances ::", self.policiesFE.keys()) self.currentT = self.policyListUpdater(W, i) print ("Current distance (t) is:: ", self.currentT ) if self.currentT <= self.epsilon: # terminate if the point reached close enough break i += 1 return W