(
    sensors: typing.List[sensor.Sensor])
return spaces.Dict(gym_space_dict)
Convert a list of sensors to the corresponding gym space dictionary.

  Args:
    sensors: a list of the current sensors

  Returns:
    space: the converted gym space dictionary

  Raises:
    UnsupportedConversionError: raises when the function cannot convert the
      given list of sensors.
Convert a list of sensors to the corresponding gym space dictionary.
Convert a list of sensors to the corresponding gym space dictionary .
def convert_sensors_to_gym_space_dictionary(
    sensors: typing.List[sensor.Sensor]) -> gym.Space:
  """Convert a list of sensors to the corresponding gym space dictionary.

  Args:
    sensors: a list of the current sensors

  Returns:
    space: the converted gym space dictionary

  Raises:
    UnsupportedConversionError: raises when the function cannot convert the
      given list of sensors.
  """
  gym_space_dict = {}
  for s in sensors:
    if isinstance(s, sensor.BoxSpaceSensor):
      gym_space_dict[s.get_name()] = spaces.Box(np.array(s.get_lower_bound()),
                                                np.array(s.get_upper_bound()),
                                                dtype=np.float32)
    else:
      raise UnsupportedConversionError('sensors = ' + str(sensors))
  return spaces.Dict(gym_space_dict)
def convert_sensors_to_gym_space_dictionary ( sensors : typing . List [ sensor . Sensor ] ) -> gym . Space : gym_space_dict = { } for s in sensors : if isinstance ( s , sensor . BoxSpaceSensor ) : gym_space_dict [ s . get_name ( ) ] = spaces . Box ( np . array ( s . get_lower_bound ( ) ) , np . array ( s . get_upper_bound ( ) ) , dtype = np . float32 ) else : raise UnsupportedConversionError ( 'sensors = ' + str ( sensors ) ) return spaces . Dict ( gym_space_dict )