docstr: :param level: (str)
      A string representing the doom level to run. This can also be a LevelSelection object.
      This should be one of the levels defined in the DoomLevel enum. For example, HEALTH_GATHERING.
  
  :param seed: (int)
      A seed to use for the random number generator when running the environment.
  
  :param frame_skip: (int)
      The number of frames to skip between any two actions given by the agent. The action will be repeated
      for all the skipped frames.
  
  :param human_control: (bool)
      A flag that allows controlling the environment using the keyboard keys.
  
  :param custom_reward_threshold: (float)
      Allows defining a custom reward that will be used to decide when the agent succeeded in passing the environment.
  
  :param visualization_parameters: (VisualizationParameters)
      The parameters used for visualizing the environment, such as the render flag, storing videos etc.
  
  :param cameras: (List[CameraTypes])
      A list of camera types to use as observation in the state returned from the environment.
      Each camera should be an enum from CameraTypes, and there are several options like an RGB observation,
      a depth map, a segmentation map, and a top down map of the enviornment.
  
  :param target_success_rate: (float)
      Stop experiment if given target success rate was achieved.
docstr_tok: [":","param","level",":","(","str",")","A","string","representing","the","doom","level","to","run",".","This","can","also","be","a","LevelSelection","object",".","This","should","be","one","of","the","levels","defined","in","the","DoomLevel","enum",".","For","example",",","HEALTH_GATHERING",".",":","param","seed",":","(","int",")","A","seed","to","use","for","the","random","number","generator","when","running","the","environment",".",":","param","frame_skip",":","(","int",")","The","number","of","frames","to","skip","between","any","two","actions","given","by","the","agent",".","The","action","will","be","repeated","for","all","the","skipped","frames",".",":","param","human_control",":","(","bool",")","A","flag","that","allows","controlling","the","environment","using","the","keyboard","keys",".",":","param","custom_reward_threshold",":","(","float",")","Allows","defining","a","custom","reward","that","will","be","used","to","decide","when","the","agent","succeeded","in","passing","the","environment",".",":","param","visualization_parameters",":","(","VisualizationParameters",")","The","parameters","used","for","visualizing","the","environment",",","such","as","the","render","flag",",","storing","videos","etc",".",":","param","cameras",":","(","List","[","CameraTypes","]",")","A","list","of","camera","types","to","use","as","observation","in","the","state","returned","from","the","environment",".","Each","camera","should","be","an","enum","from","CameraTypes",",","and","there","are","several","options","like","an","RGB","observation",",","a","depth","map",",","a","segmentation","map",",","and","a","top","down","map","of","the","enviornment",".",":","param","target_success_rate",":","(","float",")","Stop","experiment","if","given","target","success","rate","was","achieved","."]
code: def __init__(
      self,
      level: LevelSelection,
      seed: int,
      frame_skip: int,
      human_control: bool,
      custom_reward_threshold: Union[int, float],
      visualization_parameters: VisualizationParameters,
      cameras: List[CameraTypes],
      target_success_rate: float = 1.0,
      **kwargs,
  ):
      """
      :param level: (str)
          A string representing the doom level to run. This can also be a LevelSelection object.
          This should be one of the levels defined in the DoomLevel enum. For example, HEALTH_GATHERING.
  
      :param seed: (int)
          A seed to use for the random number generator when running the environment.
  
      :param frame_skip: (int)
          The number of frames to skip between any two actions given by the agent. The action will be repeated
          for all the skipped frames.
  
      :param human_control: (bool)
          A flag that allows controlling the environment using the keyboard keys.
  
      :param custom_reward_threshold: (float)
          Allows defining a custom reward that will be used to decide when the agent succeeded in passing the environment.
  
      :param visualization_parameters: (VisualizationParameters)
          The parameters used for visualizing the environment, such as the render flag, storing videos etc.
  
      :param cameras: (List[CameraTypes])
          A list of camera types to use as observation in the state returned from the environment.
          Each camera should be an enum from CameraTypes, and there are several options like an RGB observation,
          a depth map, a segmentation map, and a top down map of the enviornment.
  
      :param target_success_rate: (float)
          Stop experiment if given target success rate was achieved.
  
      """
      super().__init__(
          level,
          seed,
          frame_skip,
          human_control,
          custom_reward_threshold,
          visualization_parameters,
          target_success_rate,
      )
  
      self.cameras = cameras
  
      # load the emulator with the required level
      self.level = DoomLevel[level.upper()]
      local_scenarios_path = path.join(
          os.path.dirname(os.path.realpath(__file__)), "doom"
      )
      if "COACH_LOCAL" in level:
          self.scenarios_dir = local_scenarios_path
      elif "VIZDOOM_ROOT" in environ:
          self.scenarios_dir = path.join(
              environ.get("VIZDOOM_ROOT"), "scenarios"
          )
      else:
          self.scenarios_dir = path.join(
              os.path.dirname(os.path.realpath(vizdoom.__file__)),
              "scenarios",
          )
  
      self.game = vizdoom.DoomGame()
      self.game.load_config(
          path.join(self.scenarios_dir, self.level.value)
      )
      self.game.set_window_visible(False)
      self.game.add_game_args("+vid_forcesurface 1")
  
      self.wait_for_explicit_human_action = True
      if self.human_control:
          self.game.set_screen_resolution(
              vizdoom.ScreenResolution.RES_640X480
          )
      elif self.is_rendered:
          self.game.set_screen_resolution(
              vizdoom.ScreenResolution.RES_320X240
          )
      else:
          # lower resolution since we actually take only 76x60 and we don't need to render
          self.game.set_screen_resolution(
              vizdoom.ScreenResolution.RES_160X120
          )
  
      self.game.set_render_hud(False)
      self.game.set_render_crosshair(False)
      self.game.set_render_decals(False)
      self.game.set_render_particles(False)
      for camera in self.cameras:
          if hasattr(
              self.game, "set_{}_enabled".format(camera.value[1])
          ):
              getattr(
                  self.game, "set_{}_enabled".format(camera.value[1])
              )(True)
      self.game.init()
  
      # actions
      actions_description = ["NO-OP"]
      actions_description += [
          str(action).split(".")[1]
          for action in self.game.get_available_buttons()
      ]
      actions_description = actions_description[::-1]
      self.action_space = MultiSelectActionSpace(
          self.game.get_available_buttons_size(),
          max_simultaneous_selected_actions=1,
          descriptions=actions_description,
          allow_no_action_to_be_selected=True,
      )
  
      # human control
      if self.human_control:
          # TODO: add this to the action space
          # map keyboard keys to actions
          for idx, action in enumerate(self.action_space.descriptions):
              if action in key_map.keys():
                  self.key_to_action[(key_map[action],)] = idx
  
      # states
      self.state_space = StateSpace(
          {
              "measurements": VectorObservationSpace(
                  self.game.get_state().game_variables.shape[0],
                  measurements_names=[
                      str(m)
                      for m in self.game.get_available_game_variables()
                  ],
              )
          }
      )
      for camera in self.cameras:
          self.state_space[camera.value[0]] = ImageObservationSpace(
              shape=np.array(
                  [
                      self.game.get_screen_height(),
                      self.game.get_screen_width(),
                      3,
                  ]
              ),
              high=255,
          )
  
      # seed
      if seed is not None:
          self.game.set_seed(seed)
      self.reset_internal_state()
  
      # render
      if self.is_rendered:
          image = self.get_rendered_image()
          self.renderer.create_screen(image.shape[1], image.shape[0])
  
      self.target_success_rate = target_success_rate
  
imports: import os
  from enum import Enum
  from os import path, environ
  from typing import Union, List
  import numpy
  from rl_coach.base_parameters import VisualizationParameters
  from rl_coach.environments.environment import Environment, EnvironmentParameters, LevelSelection
  from rl_coach.filters.action.full_discrete_action_space_map import FullDiscreteActionSpaceMap
  from rl_coach.filters.filter import InputFilter, OutputFilter
  from rl_coach.filters.observation.observation_rescale_to_size_filter import ObservationRescaleToSizeFilter
  from rl_coach.filters.observation.observation_rgb_to_y_filter import ObservationRGBToYFilter
  from rl_coach.filters.observation.observation_stacking_filter import ObservationStackingFilter
  from rl_coach.filters.observation.observation_to_uint8_filter import ObservationToUInt8Filter
  from rl_coach.spaces import MultiSelectActionSpace, ImageObservationSpace, VectorObservationSpace, StateSpace
label_desc: Use image node_id 1 to create a new DoomEnvironment object from inherited base classes: Environment with example: obj = DoomEnvironment(level, seed, frame_skip, human_control, custom_reward_threshold, visualization_parameters, cameras, target_success_rate)