class_docstr: Class for converting a gym environment, a controller style, and others into a black-box optimization benchmark.
class_docstr_tok: ["Class","for","converting","a","gym","environment",",","a","controller","style",",","and","others","into","a","black-box","optimization","benchmark","."]
docstr: Do a simulation with parametrization x and return the result.
  
  Parameters:
      limited_fidelity: bool
          whether we use a limited version for the beginning of the training.
docstr_tok: ["Do","a","simulation","with","parametrization","x","and","return","the","result",".","Parameters",":","limited_fidelity",":","bool","whether","we","use","a","limited","version","for","the","beginning","of","the","training","."]
code: def gym_multi_function(
      self, x: np.ndarray, limited_fidelity: bool = False
  ) -> float:
      """Do a simulation with parametrization x and return the result.
  
      Parameters:
          limited_fidelity: bool
              whether we use a limited version for the beginning of the training.
      """
      self.num_calls += 1
      # The deterministic case consists in considering the average of 7 fixed seeds.
      # The conformant case is using 1 randomized seed (unlesss we requested !randomized).
      num_simulations = (
          7
          if self.control != "conformant" and not self.randomized
          else 1
      )
      loss = 0
      for simulation_index in range(num_simulations):
          loss += self.gym_simulate(
              x,
              seed=simulation_index
              if not self.randomized
              else self.parametrization.random_state.randint(500000),
              limited_fidelity=limited_fidelity,
          )
      return loss / num_simulations
  
imports: import os
  import copy
  import scipy.stats
  import typing
  import numpy
  import gym
  import nevergrad
  from nevergrad.parametrization import parameter
  from ..base import ExperimentFunction
label_desc: Use image node_id 10 for calling the GymMulti obj's underlying member method code with example usage: obj.gym_multi_function(x, limited_fidelity) and returns: unknown