docstr: Get the new suggested trials with grid search.
docstr_tok: ["Get","the","new","suggested","trials","with","grid","search","."]
code: def get_new_suggestions(self, study_name, trials=[], number=1):
      """
      Get the new suggested trials with grid search.
      """
      study = Study.objects.get(id=study_name)
  
      result = []
      for i in range(number):
          trial = Trial.create(study.name, "RandomSearchTrial")
          parameter_values_json = {}
  
          study_configuration_json = json.loads(
              study.study_configuration
          )
          params = study_configuration_json["params"]
          for param in params:
              min_value = param["minValue"]
              max_value = param["maxValue"]
  
              if number > 1:
                  value_step = (max_value - min_value) / (number - 1)
              else:
                  value_step = max_value - min_value
              parameter_value = min_value + value_step * i
              parameter_values_json[
                  param["parameterName"]
              ] = parameter_value
  
          trial.parameter_values = json.dumps(parameter_values_json)
          trial.save()
          result.append(trial)
  
      return result
  
file_path: advisor/advisor_server/suggestion/algorithm/particle_swarm_optimization.py
imports: from __future__ import print_function
  import json
  import random
  from suggestion.models import Study
  from suggestion.models import Trial
  from suggestion.algorithm.abstract_algorithm import AbstractSuggestionAlgorithm
label_desc: Use image node_id 2 for calling the ParticleSwarmOptimization obj's underlying member method code with example usage: obj.get_new_suggestions(study_name, trials, number) and returns: result