(self,
               physics,
               task,
               time_limit=float('inf'),
               control_timestep=None,
               n_sub_steps=None,
               flat_observation=False)
Initializes a new `Environment`.

    Args:
      physics: Instance of `Physics`.
      task: Instance of `Task`.
      time_limit: Optional `int`, maximum time for each episode in seconds. By
        default this is set to infinite.
      control_timestep: Optional control time-step, in seconds.
      n_sub_steps: Optional number of physical time-steps in one control
        time-step, aka "action repeats". Can only be supplied if
        `control_timestep` is not specified.
      flat_observation: If True, observations will be flattened and concatenated
        into a single numpy array.

    Raises:
      ValueError: If both `n_sub_steps` and `control_timestep` are supplied.
Initializes a new `Environment`.
Initializes a new Environment .
def __init__(self,
               physics,
               task,
               time_limit=float('inf'),
               control_timestep=None,
               n_sub_steps=None,
               flat_observation=False):
    """Initializes a new `Environment`.

    Args:
      physics: Instance of `Physics`.
      task: Instance of `Task`.
      time_limit: Optional `int`, maximum time for each episode in seconds. By
        default this is set to infinite.
      control_timestep: Optional control time-step, in seconds.
      n_sub_steps: Optional number of physical time-steps in one control
        time-step, aka "action repeats". Can only be supplied if
        `control_timestep` is not specified.
      flat_observation: If True, observations will be flattened and concatenated
        into a single numpy array.

    Raises:
      ValueError: If both `n_sub_steps` and `control_timestep` are supplied.
    """
    self._task = task
    self._physics = physics
    self._flat_observation = flat_observation

    if n_sub_steps is not None and control_timestep is not None:
      raise ValueError('Both n_sub_steps and control_timestep were supplied.')
    elif n_sub_steps is not None:
      self._n_sub_steps = n_sub_steps
    elif control_timestep is not None:
      self._n_sub_steps = compute_n_steps(control_timestep,
                                          self._physics.timestep())
    else:
      self._n_sub_steps = 1

    if time_limit == float('inf'):
      self._step_limit = float('inf')
    else:
      self._step_limit = time_limit / (
          self._physics.timestep() * self._n_sub_steps)
    self._step_count = 0
    self._reset_next_step = True
def __init__ ( self , physics , task , time_limit = float ( 'inf' ) , control_timestep = None , n_sub_steps = None , flat_observation = False ) : self . _task = task self . _physics = physics self . _flat_observation = flat_observation if n_sub_steps is not None and control_timestep is not None : raise ValueError ( 'Both n_sub_steps and control_timestep were supplied.' ) elif n_sub_steps is not None : self . _n_sub_steps = n_sub_steps elif control_timestep is not None : self . _n_sub_steps = compute_n_steps ( control_timestep , self . _physics . timestep ( ) ) else : self . _n_sub_steps = 1 if time_limit == float ( 'inf' ) : self . _step_limit = float ( 'inf' ) else : self . _step_limit = time_limit / ( self . _physics . timestep ( ) * self . _n_sub_steps ) self . _step_count = 0 self . _reset_next_step = True