(self, latency)
return observation
Get observation that is delayed by the amount specified in latency.

    Args:
      latency: The latency (in seconds) of the delayed observation.

    Returns:
      observation: The observation which was actually latency seconds ago.
Get observation that is delayed by the amount specified in latency.
Get observation that is delayed by the amount specified in latency .
def _GetDelayedObservation(self, latency):
    """Get observation that is delayed by the amount specified in latency.

    Args:
      latency: The latency (in seconds) of the delayed observation.

    Returns:
      observation: The observation which was actually latency seconds ago.
    """
    if latency <= 0 or len(self._observation_history) == 1:
      observation = self._observation_history[0]
    else:
      n_steps_ago = int(latency / self.time_step)
      if n_steps_ago + 1 >= len(self._observation_history):
        return self._observation_history[-1]
      remaining_latency = latency - n_steps_ago * self.time_step
      blend_alpha = remaining_latency / self.time_step
      observation = (
          (1.0 - blend_alpha) *
          np.array(self._observation_history[n_steps_ago]) +
          blend_alpha * np.array(self._observation_history[n_steps_ago + 1]))
    return observation
def _GetDelayedObservation ( self , latency ) : if latency <= 0 or len ( self . _observation_history ) == 1 : observation = self . _observation_history [ 0 ] else : n_steps_ago = int ( latency / self . time_step ) if n_steps_ago + 1 >= len ( self . _observation_history ) : return self . _observation_history [ - 1 ] remaining_latency = latency - n_steps_ago * self . time_step blend_alpha = remaining_latency / self . time_step observation = ( ( 1.0 - blend_alpha ) * np . array ( self . _observation_history [ n_steps_ago ] ) + blend_alpha * np . array ( self . _observation_history [ n_steps_ago + 1 ] ) ) return observation