code: def SolutionImprovement(tolerance=1e-5):
      """sum of change in each parameter is < tolerance:
  
      ``sum(abs(last_params - current_params)) <= tolerance``"""
      doc = "SolutionImprovement with %s" % {"tolerance": tolerance}
  
      def _SolutionImprovement(inst, info=False):
          if info:
              info = lambda x: x
          else:
              info = bool
          best = numpy.array(inst.bestSolution)
          trial = numpy.array(inst.trialSolution)
          update = abs(best - trial)  # XXX: if inf - inf ?
          answer = numpy.add.reduce(update.T)
          if isinstance(
              answer, numpy.ndarray
          ):  # if trialPop, take 'best' answer
              answer = max(answer)  # XXX: is this 'best' or 'worst'?
          answer = answer <= tolerance
          if answer:
              return info(doc)
          return info(null)
  
      _SolutionImprovement.__doc__ = doc
      return _SolutionImprovement
  
imports: import numpy
  import mystic.collapse
  from mystic.math.distance import Lnorm
  from mystic._scipy060optimize import approx_fprime, _epsilon
label_desc: Use image node_id 7 for calling a global function with example usage: SolutionImprovement(tolerance) and returns: _SolutionImprovement, info, info