code: def _meta_fitness_func(parameters,
                         _optimizer,
                         _problems,
                         _master_fitness_dict,
                         _runs=20):
      
      # Create the optimizer with parameters encoded in solution
      optimizer = copy.deepcopy(_optimizer)
      optimizer._set_hyperparameters(parameters)
      optimizer.logging = False
  
      # Preload fitness dictionary from master, and disable clearing dict
      # NOTE: master_fitness_dict will be modified inline, and therefore,
      # we do not need to take additional steps to update it
      if _master_fitness_dict != None:  # None means low memory mode
          optimizer.clear_cache = False
          optimizer._Optimizer__encoded_cache = _master_fitness_dict
  
      # Because metaheuristics are stochastic, we run the optimizer multiple times,
      # to obtain an average of performance
      all_evaluation_runs = []
      solutions_found = []
      for _ in range(_runs):
          for problem in _problems:
              # Get performance for problem
              optimizer.optimize(problem)
              all_evaluation_runs.append(optimizer.fitness_runs)
              if optimizer.solution_found:
                  solutions_found.append(1.0)
              else:
                  solutions_found.append(0.0)
  
      # Our main goal is to minimize time the optimizer takes
      fitness = 1.0 / helpers.avg(all_evaluation_runs)
  
      # Optimizer is heavily penalized for missing solutions
      # To avoid 0 fitness
      fitness = fitness * helpers.avg(solutions_found)**2 + 1e-19
  
      return fitness
docs: Test a metaheuristic with parameters encoded in solution.
  
      Our goal is to minimize number of evaluation runs until a solution is found,
      while maximizing chance of finding solution to the underlying problem
      NOTE: while meta optimization requires a 'known' solution, this solution
      can be an estimate to provide the meta optimizer with a sense of progress.