src/TrafficCoordinator.py
def one_bid_per_agent_queue(self, bid_queue):
        ''' Returns a queue that only has one bid/request per agent'''
        agent_max_requests = {}
        cleaned_queue = []
        for bid, requested_start_time, end_time, intersection_lane, agent_id, current_car in bid_queue:
            if agent_id in agent_max_requests.keys():
                if bid > agent_max_requests[agent_id][0]:
                    agent_max_requests[agent_id] = (bid, requested_start_time, end_time, intersection_lane, agent_id, current_car)
            else:
                agent_max_requests[agent_id] = (bid, requested_start_time, end_time, intersection_lane, agent_id, current_car)
        for agent_id in agent_max_requests.keys():
            cleaned_queue += [agent_max_requests[agent_id]]
        return cleaned_queue
 Returns a queue that only has one bid/request per agent
Returns a queue that only has one bid/request per agent
Returns a queue that only has one bid / request per agent
def one_bid_per_agent_queue(self, bid_queue):
        agent_max_requests = {}
        cleaned_queue = []
        for bid, requested_start_time, end_time, intersection_lane, agent_id, current_car in bid_queue:
            if agent_id in agent_max_requests.keys():
                if bid > agent_max_requests[agent_id][0]:
                    agent_max_requests[agent_id] = (bid, requested_start_time, end_time, intersection_lane, agent_id, current_car)
            else:
                agent_max_requests[agent_id] = (bid, requested_start_time, end_time, intersection_lane, agent_id, current_car)
        for agent_id in agent_max_requests.keys():
            cleaned_queue += [agent_max_requests[agent_id]]
        return cleaned_queue
def one_bid_per_agent_queue ( self , bid_queue ) : agent_max_requests = { } cleaned_queue = [ ] for bid , requested_start_time , end_time , intersection_lane , agent_id , current_car in bid_queue : if agent_id in agent_max_requests . keys ( ) : if bid > agent_max_requests [ agent_id ] [ 0 ] : agent_max_requests [ agent_id ] = ( bid , requested_start_time , end_time , intersection_lane , agent_id , current_car ) else : agent_max_requests [ agent_id ] = ( bid , requested_start_time , end_time , intersection_lane , agent_id , current_car ) for agent_id in agent_max_requests . keys ( ) : cleaned_queue += [ agent_max_requests [ agent_id ] ] return cleaned_queue
Returns a queue that only has one bid/request per agent
Returns a queue that only has one bid / request per agent
''' Returns a queue that only has one bid/request per agent'''
self
bid_queue