#NEWLINE# def generateNewShapeGivenFeedback( self , bestShape ) : #NEWLINE# #INDENT# self . respondToFeedback ( bestShape ) #NEWLINE# if ( ( ( abs ( ( self . bounds [ ( 0 , 1 ) ] - self . bestParamValue ) ) - self . minParamDiff ) < tol ) and ( ( abs ( ( self . bestParamValue - self . bounds [ ( 0 , 0 ) ] ) ) - self . minParamDiff ) < tol ) ) : #NEWLINE# #INDENT# self . converged = True #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . converged = False #NEWLINE# #UNINDENT# self . numIters += 1 #NEWLINE# if ( not self . converged ) : #NEWLINE# #INDENT# self . numItersConverged = 0 #NEWLINE# [ newShape , newParamValue ] = self . makeShapeDifferentTo ( self . bestParamValue ) #NEWLINE# self . newParamValue = newParamValue #NEWLINE# return ( self . numItersConverged , newShape , newParamValue ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . numItersConverged += 1 #NEWLINE# [ newShape , newParamValue ] = self . makeShapeSimilarTo ( self . bestParamValue ) #NEWLINE# self . newParamValue = newParamValue #NEWLINE# return ( self . numItersConverged , newShape , newParamValue )