src/TrafficCoordinator.py
def sort_queue(self, bid_queue, sorting_string):
        ''' Sorts the queue by predefined sorting.  Assumes queue only has one bid per agent
            sorting_string == "FCFS":  highest bid is first in queue
            sorting_string == "FCFSagent_id":  highest bid is first, ties broken by agent_id
        '''
        sorted_queue = []
        if sorting_string == "FCFS":
           sorted_queue = sorted(bid_queue,key=lambda b: -b[0])
        elif sorting_string == "FCFSagent_id":
            sorted_queue = self.sort_and_break_ties_id(bid_queue)
        elif sorting_string == "FCFSlane":
            sorted_queue = self.sort_and_break_ties_lane(bid_queue)
        else:
            raise Exception("Unknown Sorting String")
        return sorted_queue
 Sorts the queue by predefined sorting.  Assumes queue only has one bid per agent
            sorting_string == "FCFS":  highest bid is first in queue
            sorting_string == "FCFSagent_id":  highest bid is first, ties broken by agent_id
        
Sorts the queue by predefined sorting.  Assumes queue only has one bid per agent
sorting_string == "FCFS":  highest bid is first in queue
sorting_string == "FCFSagent_id":  highest bid is first, ties broken by agent_id
Sorts the queue by predefined sorting . Assumes queue only has one bid per agent sorting_string == " FCFS " : highest bid is first in queue sorting_string == " FCFSagent_id " : highest bid is first ties broken by agent_id
def sort_queue(self, bid_queue, sorting_string):
        sorted_queue = []
        if sorting_string == "FCFS":
           sorted_queue = sorted(bid_queue,key=lambda b: -b[0])
        elif sorting_string == "FCFSagent_id":
            sorted_queue = self.sort_and_break_ties_id(bid_queue)
        elif sorting_string == "FCFSlane":
            sorted_queue = self.sort_and_break_ties_lane(bid_queue)
        else:
            raise Exception("Unknown Sorting String")
        return sorted_queue
def sort_queue ( self , bid_queue , sorting_string ) : sorted_queue = [ ] if sorting_string == "FCFS" : sorted_queue = sorted ( bid_queue , key = lambda b : - b [ 0 ] ) elif sorting_string == "FCFSagent_id" : sorted_queue = self . sort_and_break_ties_id ( bid_queue ) elif sorting_string == "FCFSlane" : sorted_queue = self . sort_and_break_ties_lane ( bid_queue ) else : raise Exception ( "Unknown Sorting String" ) return sorted_queue
Sorts the queue by predefined sorting.
Sorts the queue by predefined sorting .
''' Sorts the queue by predefined sorting.  Assumes queue only has one bid per agent
            sorting_string == "FCFS":  highest bid is first in queue
            sorting_string == "FCFSagent_id":  highest bid is first, ties broken by agent_id
        '''
self
bid_queue
sorting_string