src/TrafficCoordinator.py
def attempt_one_reservation(self, request):
        ''' Try to assign a single vehicle to the intersection.  First checks time intersection would be available for vehicle. 
            Then if it is available, reserves the matrix and returns the updated reservation matrices 
        '''
        fake_lane_queues = self.copy_queues(self.lane_queues)
        (bid, requested_start_time, end_time, intersection_lane, agent_id, current_car) = request
        time_car_can_enter_intersection = self.get_intersection_available_for_car(current_car.current_lane, 
                                                    current_car, fake_lane_queues, self.strict_priority)
        start_time, t_interval_matrix_after_reservation, t_available_matrix_after_reservation = self.attempt_reservation(time_car_can_enter_intersection, intersection_lane, current_car, agent_id, self.time_matrix_intervals, self.time_available_matrix)
        if start_time < 0 or (start_time > self.time + self.k_max_start_time_horizon): #NOTE THIS IS RISKY BUSINESS
            return -1, self.time_matrix_intervals, self.time_available_matrix, self.lane_queues
        else:
            time_intersection_entrance_free = self.get_intersection_entrance_free_time(current_car.current_lane, t_available_matrix_after_reservation)
            fake_lane_queues[current_car.current_lane] += [(current_car, time_intersection_entrance_free)] #TODO:  This needs to be when I'm out of the control region
        return start_time, t_interval_matrix_after_reservation, t_available_matrix_after_reservation, fake_lane_queues
 Try to assign a single vehicle to the intersection.  First checks time intersection would be available for vehicle. 
            Then if it is available, reserves the matrix and returns the updated reservation matrices 
        
Try to assign a single vehicle to the intersection.  First checks time intersection would be available for vehicle.
Then if it is available, reserves the matrix and returns the updated reservation matrices
Try to assign a single vehicle to the intersection . First checks time intersection would be available for vehicle . Then if it is available reserves the matrix and returns the updated reservation matrices
def attempt_one_reservation(self, request):
        fake_lane_queues = self.copy_queues(self.lane_queues)
        (bid, requested_start_time, end_time, intersection_lane, agent_id, current_car) = request
        time_car_can_enter_intersection = self.get_intersection_available_for_car(current_car.current_lane, 
                                                    current_car, fake_lane_queues, self.strict_priority)
        start_time, t_interval_matrix_after_reservation, t_available_matrix_after_reservation = self.attempt_reservation(time_car_can_enter_intersection, intersection_lane, current_car, agent_id, self.time_matrix_intervals, self.time_available_matrix)
        if start_time < 0 or (start_time > self.time + self.k_max_start_time_horizon): 
            return -1, self.time_matrix_intervals, self.time_available_matrix, self.lane_queues
        else:
            time_intersection_entrance_free = self.get_intersection_entrance_free_time(current_car.current_lane, t_available_matrix_after_reservation)
            fake_lane_queues[current_car.current_lane] += [(current_car, time_intersection_entrance_free)] 
        return start_time, t_interval_matrix_after_reservation, t_available_matrix_after_reservation, fake_lane_queues
def attempt_one_reservation ( self , request ) : fake_lane_queues = self . copy_queues ( self . lane_queues ) ( bid , requested_start_time , end_time , intersection_lane , agent_id , current_car ) = request time_car_can_enter_intersection = self . get_intersection_available_for_car ( current_car . current_lane , current_car , fake_lane_queues , self . strict_priority ) start_time , t_interval_matrix_after_reservation , t_available_matrix_after_reservation = self . attempt_reservation ( time_car_can_enter_intersection , intersection_lane , current_car , agent_id , self . time_matrix_intervals , self . time_available_matrix ) if start_time < 0 or ( start_time > self . time + self . k_max_start_time_horizon ) : return - 1 , self . time_matrix_intervals , self . time_available_matrix , self . lane_queues else : time_intersection_entrance_free = self . get_intersection_entrance_free_time ( current_car . current_lane , t_available_matrix_after_reservation ) fake_lane_queues [ current_car . current_lane ] += [ ( current_car , time_intersection_entrance_free ) ] return start_time , t_interval_matrix_after_reservation , t_available_matrix_after_reservation , fake_lane_queues
Try to assign a single vehicle to the intersection.
Try to assign a single vehicle to the intersection .
''' Try to assign a single vehicle to the intersection.  First checks time intersection would be available for vehicle. 
            Then if it is available, reserves the matrix and returns the updated reservation matrices 
        ''' #NOTE THIS IS RISKY BUSINESS #TODO:  This needs to be when I'm out of the control region
self
request