============================ V E N D O R C H O O S E R ============================ The Vendor Chooser algorithm converts pre-orders into complete orders. For each pre-order, it selects a vendor and item type, computes its cost, and adds the room, start time, and duration of the event. -= Input and output =- Input: Current schedule, vendor description, pre-order list Output: Order list Note that the input pre-order list must be for the input schedule; that is, each pre-order must refer to an event in the schedule. -= Main steps =- Create an empty Order-List For every Pre-Order: Best-Cost = +Infinity For each Item-Type that matches the service property in Pre-Order: For each known Vendor: If Vendor offers Item-Type at a known cost: Let Cost be the total cost of ordering such items from this vendor, for the number of items and event duration specified in Pre-Order If Cost < Best-Cost: Best-Vendor = Vendor; Best-Item-Type = Item-Type; Best-Cost = Cost If Best-Cost == +Infinity, then terminate with an error Create Order from Pre-Order, by adding Best-Vendor, Best-Item-Type, and Best-Cost, as well as the room, start time, and duration of the event Add Order to Order-List Return Order-List