parameters: (self, vehicle, target_speed=20, opt_dict={})
docstring: Initialization the agent paramters, the local and the global planner.
  
              :param vehicle: actor to apply to agent logic onto
              :param target_speed: speed (in Km/h) at which the vehicle will move
              :param opt_dict: dictionary in case some of its parameters want to be changed.
                  This also applies to parameters related to the LocalPlanner.
docstring_summary: Initialization the agent paramters, the local and the global planner.
docstring_tokens: Initialization the agent paramters the local and the global planner .
function: def __init__(self, vehicle, target_speed=20, opt_dict={}):
          """
          Initialization the agent paramters, the local and the global planner.
  
              :param vehicle: actor to apply to agent logic onto
              :param target_speed: speed (in Km/h) at which the vehicle will move
              :param opt_dict: dictionary in case some of its parameters want to be changed.
                  This also applies to parameters related to the LocalPlanner.
          """
          self._vehicle = vehicle
          self._world = self._vehicle.get_world()
          self._map = self._world.get_map()
          self._last_traffic_light = None
  
          # Base parameters
          self._ignore_traffic_lights = False
          self._ignore_stop_signs = False
          self._ignore_vehicles = False
          self._target_speed = target_speed
          self._sampling_resolution = 2.0
          self._base_tlight_threshold = 5.0  # meters
          self._base_vehicle_threshold = 5.0  # meters
          self._max_brake = 0.5
  
          # Change parameters according to the dictionary
          opt_dict['target_speed'] = target_speed
          if 'ignore_traffic_lights' in opt_dict:
              self._ignore_traffic_lights = opt_dict['ignore_traffic_lights']
          if 'ignore_stop_signs' in opt_dict:
              self._ignore_stop_signs = opt_dict['ignore_stop_signs']
          if 'ignore_vehicles' in opt_dict:
              self._ignore_vehicles = opt_dict['ignore_vehicles']
          if 'sampling_resolution' in opt_dict:
              self._sampling_resolution = opt_dict['sampling_resolution']
          if 'base_tlight_threshold' in opt_dict:
              self._base_tlight_threshold = opt_dict['base_tlight_threshold']
          if 'base_vehicle_threshold' in opt_dict:
              self._base_vehicle_threshold = opt_dict['base_vehicle_threshold']
          if 'max_brake' in opt_dict:
              self._max_steering = opt_dict['max_brake']
  
          # Initialize the planners
          self._local_planner = LocalPlanner(self._vehicle, opt_dict=opt_dict)
          self._global_planner = GlobalRoutePlanner(self._map, self._sampling_resolution)
function_tokens: def __init__ ( self , vehicle , target_speed = 20 , opt_dict = { } ) : self . _vehicle = vehicle self . _world = self . _vehicle . get_world ( ) self . _map = self . _world . get_map ( ) self . _last_traffic_light = None # Base parameters self . _ignore_traffic_lights = False self . _ignore_stop_signs = False self . _ignore_vehicles = False self . _target_speed = target_speed self . _sampling_resolution = 2.0 self . _base_tlight_threshold = 5.0 # meters self . _base_vehicle_threshold = 5.0 # meters self . _max_brake = 0.5 # Change parameters according to the dictionary opt_dict [ 'target_speed' ] = target_speed if 'ignore_traffic_lights' in opt_dict : self . _ignore_traffic_lights = opt_dict [ 'ignore_traffic_lights' ] if 'ignore_stop_signs' in opt_dict : self . _ignore_stop_signs = opt_dict [ 'ignore_stop_signs' ] if 'ignore_vehicles' in opt_dict : self . _ignore_vehicles = opt_dict [ 'ignore_vehicles' ] if 'sampling_resolution' in opt_dict : self . _sampling_resolution = opt_dict [ 'sampling_resolution' ] if 'base_tlight_threshold' in opt_dict : self . _base_tlight_threshold = opt_dict [ 'base_tlight_threshold' ] if 'base_vehicle_threshold' in opt_dict : self . _base_vehicle_threshold = opt_dict [ 'base_vehicle_threshold' ] if 'max_brake' in opt_dict : self . _max_steering = opt_dict [ 'max_brake' ] # Initialize the planners self . _local_planner = LocalPlanner ( self . _vehicle , opt_dict = opt_dict ) self . _global_planner = GlobalRoutePlanner ( self . _map , self . _sampling_resolution )