(self,
               wrapped_sensor: sensor.BoxSpaceSensor,
               num_history: int,
               append_history_axis: bool = False,
               name: typing.Text = None)
Constructs HistoricSensorWrapper.

    Note that the history begins with the recent one and becomes older. In
    other world, the most recent observation is the first item in the
    history buffer.

    Args:
      wrapped_sensor: an inner sensor that you wrap around
      num_history: the history of sensors want to maintain
      append_history_axis: if True, add an extra axis at the end of the
        observation array for history. If False, stack the historical
        observations without adding an axis.
      name: label for the sensor. Defaults to HistoricSensorWrapper(<wrapped
        sensor name>).
Constructs HistoricSensorWrapper.
Constructs HistoricSensorWrapper .
def __init__(self,
               wrapped_sensor: sensor.BoxSpaceSensor,
               num_history: int,
               append_history_axis: bool = False,
               name: typing.Text = None) -> None:
    """Constructs HistoricSensorWrapper.

    Note that the history begins with the recent one and becomes older. In
    other world, the most recent observation is the first item in the
    history buffer.

    Args:
      wrapped_sensor: an inner sensor that you wrap around
      num_history: the history of sensors want to maintain
      append_history_axis: if True, add an extra axis at the end of the
        observation array for history. If False, stack the historical
        observations without adding an axis.
      name: label for the sensor. Defaults to HistoricSensorWrapper(<wrapped
        sensor name>).
    """
    self._num_history = num_history
    self._append_history_axis = append_history_axis
    name = name or "HistoricSensorWrapper(%s)" % wrapped_sensor.get_name()
    if self._append_history_axis:
      lower_bound = np.tile(
          np.expand_dims(wrapped_sensor.get_lower_bound(), -1),
          (1, self._num_history))
      upper_bound = np.tile(
          np.expand_dims(wrapped_sensor.get_upper_bound(), -1),
          (1, self._num_history))
    else:
      lower_bound = np.tile(wrapped_sensor.get_lower_bound(),
                            self._num_history)
      upper_bound = np.tile(wrapped_sensor.get_upper_bound(),
                            self._num_history)
    shape = lower_bound.shape

    self._history_buffer = None
    super(HistoricSensorWrapper, self).__init__(name=name,
                                                shape=shape,
                                                lower_bound=lower_bound,
                                                upper_bound=upper_bound,
                                                wrapped_sensor=wrapped_sensor)
def __init__ ( self , wrapped_sensor : sensor . BoxSpaceSensor , num_history : int , append_history_axis : bool = False , name : typing . Text = None ) -> None : self . _num_history = num_history self . _append_history_axis = append_history_axis name = name or "HistoricSensorWrapper(%s)" % wrapped_sensor . get_name ( ) if self . _append_history_axis : lower_bound = np . tile ( np . expand_dims ( wrapped_sensor . get_lower_bound ( ) , - 1 ) , ( 1 , self . _num_history ) ) upper_bound = np . tile ( np . expand_dims ( wrapped_sensor . get_upper_bound ( ) , - 1 ) , ( 1 , self . _num_history ) ) else : lower_bound = np . tile ( wrapped_sensor . get_lower_bound ( ) , self . _num_history ) upper_bound = np . tile ( wrapped_sensor . get_upper_bound ( ) , self . _num_history ) shape = lower_bound . shape self . _history_buffer = None super ( HistoricSensorWrapper , self ) . __init__ ( name = name , shape = shape , lower_bound = lower_bound , upper_bound = upper_bound , wrapped_sensor = wrapped_sensor )