src/TrafficCoordinator.py
def insert_bid_to_queue(self,start_time,end_time,intersection_lane,agent_id,car_object,bid):
        ''' Insert bid into the queue but first only keep one bid per agent'''
        if car_object.agent_id not in self.max_bid_per_agent.keys():
            if car_object.agent_id >= 0:
                self.max_bid_per_agent[car_object.agent_id] = (bid,start_time,end_time,intersection_lane,agent_id,car_object)
        elif bid > self.max_bid_per_agent[car_object.agent_id][0]:
            self.max_bid_per_agent[car_object.agent_id] = (bid,start_time,end_time,intersection_lane,agent_id,car_object)
        self.bid_queue = [self.max_bid_per_agent[agent_id] for agent_id in self.max_bid_per_agent.keys()]
 Insert bid into the queue but first only keep one bid per agent
Insert bid into the queue but first only keep one bid per agent
Insert bid into the queue but first only keep one bid per agent
def insert_bid_to_queue(self,start_time,end_time,intersection_lane,agent_id,car_object,bid):
        if car_object.agent_id not in self.max_bid_per_agent.keys():
            if car_object.agent_id >= 0:
                self.max_bid_per_agent[car_object.agent_id] = (bid,start_time,end_time,intersection_lane,agent_id,car_object)
        elif bid > self.max_bid_per_agent[car_object.agent_id][0]:
            self.max_bid_per_agent[car_object.agent_id] = (bid,start_time,end_time,intersection_lane,agent_id,car_object)
        self.bid_queue = [self.max_bid_per_agent[agent_id] for agent_id in self.max_bid_per_agent.keys()]
def insert_bid_to_queue ( self , start_time , end_time , intersection_lane , agent_id , car_object , bid ) : if car_object . agent_id not in self . max_bid_per_agent . keys ( ) : if car_object . agent_id >= 0 : self . max_bid_per_agent [ car_object . agent_id ] = ( bid , start_time , end_time , intersection_lane , agent_id , car_object ) elif bid > self . max_bid_per_agent [ car_object . agent_id ] [ 0 ] : self . max_bid_per_agent [ car_object . agent_id ] = ( bid , start_time , end_time , intersection_lane , agent_id , car_object ) self . bid_queue = [ self . max_bid_per_agent [ agent_id ] for agent_id in self . max_bid_per_agent . keys ( ) ]
Insert bid into the queue but first only keep one bid per agent
Insert bid into the queue but first only keep one bid per agent
''' Insert bid into the queue but first only keep one bid per agent'''
self
start_time
end_time
intersection_lane
agent_id
car_object
bid