======================= U T I L I T Y C A L C ======================= The Utility Calc algorithm determines the utilities of order changes, and sorts changes by their utilities. For each change, it computes the impacts of the change on the schedule score and cost penalty, and determines the overall utility as the total of these two impacts. Note that, since the dependency of the cost penalty on the total cost in nonlinear, the penalty for placing or cancelling a specific order depends of the current total cost. Thus, the utilities of order changes depend on the ordering of these changes. When the system computes utilities of order changes, it assumes that we follow the suggested ordering when making these changes. -= Input and output =- Input: Old order list, new order list, list of order changes, list of resource functions, total cost Output: Sorted list of order changes with utilities The input list of order changes should not include utilities; if it does, the algorithm ignores them. The "total cost" in the input is the total of all expenses before making any changes; it includes not only order costs, but also all other conference-related costs. -= Main steps =- Set Current-Cost to the given total cost Create Old-List, which initially includes all order changes Create New-List, which is initially empty For every Change in Old-List: Compute Score[Change], which is the impact of Change on the schedule score Comment: "Score" is positive for placements, negative for cancellations, and may be either for modifications Compute Cost[Change], which is the impact of Change on the total cost Comment: "Cost" is positive for placements, negative for cancellations, and may be either for modifications Repeat while Old-List is nonempty: For every Change in Old-List: Compute Penalty[Change], which is the impact of Change on the cost penalty, assuming that the total cost before Change is Current-Cost Comment: "Penalty" is negative for placements, positive for cancellations, any may be either for modifications Utility[Change] = Score[Change] + Penalty[Change] Select Change with the greatest Utility from Old-List; if several changes in Old-List have the same greatest Utility, select Change with the smallest Cost among them Comment: "Cost" should be the smallest in the math sense; for example, -100 is smaller than -50 Remove Change from Old-List, and add it to the end of New-List Current-Cost = Current-Cost + Cost[Change] Return New-List