class_docstr: SumoTLManager is responsible for the management of the sumo traffic lights (i.e., keeps control
  of the current program, phase, ...)
class_docstr_tok: ["SumoTLManager","is","responsible","for","the","management","of","the","sumo","traffic","lights","(","i.e.",",","keeps","control","of","the","current","program",",","phase",",","...",")"]
code: def __init__(self):
      self._tls = {}  # {tlid: {program_id: SumoTLLogic}
      self._current_program = {}  # {tlid: program_id}
      self._current_phase = {}  # {tlid: index_phase}
  
      for tlid in traci.trafficlight.getIDList():
          self.subscribe(tlid)
  
          self._tls[tlid] = {}
          for tllogic in traci.trafficlight.getAllProgramLogics(tlid):
              states = [phase.state for phase in tllogic.getPhases()]
              parameters = tllogic.getParameters()
              tl = SumoTLLogic(tlid, states, parameters)
              self._tls[tlid][tllogic.programID] = tl
  
          # Get current status of the traffic lights.
          self._current_program[tlid] = traci.trafficlight.getProgram(
              tlid
          )
          self._current_phase[tlid] = traci.trafficlight.getPhase(tlid)
  
      self._off = False
  
imports: import collections
  import enum
  import logging
  import os
  import carla
  import sumolib
  import traci
  from .constants import INVALID_ACTOR_ID
  import lxml.etree
label_desc: Use image node_id 1 to create a new SumoTLManager object from inherited base classes: object with example: obj = SumoTLManager()