class_docstr: CarlaSimulation is responsible for the management of the carla simulation.
class_docstr_tok: ["CarlaSimulation","is","responsible","for","the","management","of","the","carla","simulation","."]
code: def __init__(self, host, port, step_length):
      self.client = carla.Client(host, port)
      self.client.set_timeout(2.0)
  
      self.world = self.client.get_world()
      self.blueprint_library = self.world.get_blueprint_library()
      self.step_length = step_length
  
      # The following sets contain updated information for the current frame.
      self._active_actors = set()
      self.spawned_actors = set()
      self.destroyed_actors = set()
  
      # Set traffic lights.
      self._tls = {}  # {landmark_id: traffic_ligth_actor}
  
      tmp_map = self.world.get_map()
      for landmark in tmp_map.get_all_landmarks_of_type("1000001"):
          if landmark.id != "":
              traffic_ligth = self.world.get_traffic_light(landmark)
              if traffic_ligth is not None:
                  self._tls[landmark.id] = traffic_ligth
              else:
                  logging.warning(
                      "Landmark %s is not linked to any traffic light",
                      landmark.id,
                  )
  
file_path: carla/Co-Simulation/Sumo/sumo_integration/carla_simulation.py
imports: import logging
  import carla
  from .constants import INVALID_ACTOR_ID, SPAWN_OFFSET_Z
label_desc: Use image node_id 1 to create a new CarlaSimulation object from inherited base classes: object with example: obj = CarlaSimulation(host, port, step_length)