src/TrafficCoordinator.py
def calculate_reservation(self, car_intersection_start_time, intersection_lane, current_car, agent_id, time_matrix_intervals):
        ''' Calculate and returns the positions/intervals required by the vehicle in the intersection.  If there is a conflict, no points are returned
        An additional time_buffer_interval is added when reserving an interval
        '''
        list_of_positions_time = self.forward_simulate(car_intersection_start_time, intersection_lane, current_car)
        intersection_points_to_reserve = []
        for x, y, phi, t in list_of_positions_time:
            points_covered_by_car = self.get_points_covered_by_car(x, y, phi, current_car.car_width, current_car.car_length, current_car.notcommunicating)
            for point in points_covered_by_car:
                i,j = self.matrix_index_from_xy(point.x, point.y)
                if self.conflicts_in_interval_bool((t-self.time_buffer_interval,t+self.time_buffer_interval,agent_id), i, j, time_matrix_intervals):
                    return []
                else:
                    intersection_points_to_reserve += [(t - self.time_buffer_interval, t + self.time_buffer_interval, i, j)]
        return intersection_points_to_reserve
 Calculate and returns the positions/intervals required by the vehicle in the intersection.  If there is a conflict, no points are returned
        An additional time_buffer_interval is added when reserving an interval
        
Calculate and returns the positions/intervals required by the vehicle in the intersection.  If there is a conflict, no points are returned
An additional time_buffer_interval is added when reserving an interval
Calculate and returns the positions / intervals required by the vehicle in the intersection . If there is a conflict no points are returned An additional time_buffer_interval is added when reserving an interval
def calculate_reservation(self, car_intersection_start_time, intersection_lane, current_car, agent_id, time_matrix_intervals):
        list_of_positions_time = self.forward_simulate(car_intersection_start_time, intersection_lane, current_car)
        intersection_points_to_reserve = []
        for x, y, phi, t in list_of_positions_time:
            points_covered_by_car = self.get_points_covered_by_car(x, y, phi, current_car.car_width, current_car.car_length, current_car.notcommunicating)
            for point in points_covered_by_car:
                i,j = self.matrix_index_from_xy(point.x, point.y)
                if self.conflicts_in_interval_bool((t-self.time_buffer_interval,t+self.time_buffer_interval,agent_id), i, j, time_matrix_intervals):
                    return []
                else:
                    intersection_points_to_reserve += [(t - self.time_buffer_interval, t + self.time_buffer_interval, i, j)]
        return intersection_points_to_reserve
def calculate_reservation ( self , car_intersection_start_time , intersection_lane , current_car , agent_id , time_matrix_intervals ) : list_of_positions_time = self . forward_simulate ( car_intersection_start_time , intersection_lane , current_car ) intersection_points_to_reserve = [ ] for x , y , phi , t in list_of_positions_time : points_covered_by_car = self . get_points_covered_by_car ( x , y , phi , current_car . car_width , current_car . car_length , current_car . notcommunicating ) for point in points_covered_by_car : i , j = self . matrix_index_from_xy ( point . x , point . y ) if self . conflicts_in_interval_bool ( ( t - self . time_buffer_interval , t + self . time_buffer_interval , agent_id ) , i , j , time_matrix_intervals ) : return [ ] else : intersection_points_to_reserve += [ ( t - self . time_buffer_interval , t + self . time_buffer_interval , i , j ) ] return intersection_points_to_reserve
Calculate and returns the positions/intervals required by the vehicle in the intersection.
Calculate and returns the positions / intervals required by the vehicle in the intersection .
''' Calculate and returns the positions/intervals required by the vehicle in the intersection.  If there is a conflict, no points are returned
        An additional time_buffer_interval is added when reserving an interval
        '''
self
car_intersection_start_time
intersection_lane
current_car
agent_id
time_matrix_intervals