Algorithm Bidder
      Messages of unknown type are silently ignored.
timer  SET-TIMER
while  NOT-EXPIRED    (timer)
   auction-id, auction-type, auction-data
   if  MESSAGE-TYPE (msg) = “SINGLE
   bid   CREATE-BID (auction-id, auction-type, auction-data)
    SEND-BID (bid)
  else if  MESSAGE-TYPE (msg) = “MULTIPLE
  end if
  else if  MESSAGE-TYPE (msg) = “AUCTION-WINNER”   then
   auctioneer   GET-SENDER (msg)
   auction-id, auction-data PARSE-WON-MESSAGE (msg)
          Note that we acknowledge regardless of whether or not we find the bid.
   SEND-WIN-ACKNOWLEDGEMENT (auctioneer, auction-id)
   bid    FIND-BID (msg)
   if   bid nil  then
    ADD-TASK (auction-data)
    CLOSE-BID (bid)
   end if
  end if
end while
end loop
Algorithm 1: Bidder agent response to auctioneer in LAAF.