Skip to main content
function minimizeCost(opts?): RuleEntry;
Tells the solver to minimize total labor cost.

Parameters

Returns

RuleEntry Without this rule, cost modifiers only affect post-solve calculation. When present, the solver actively prefers cheaper assignments. For hourly members, penalizes each assignment proportionally to cost. For salaried members, adds a fixed weekly salary cost when they have any assignment that week (zero marginal cost up to contracted hours). Cost modifiers adjust the calculation:
  • dayMultiplier(factor, opts?) - multiply base rate on specific days
  • daySurcharge(amount, opts?) - flat extra per hour on specific days
  • timeSurcharge(amount, window, opts?) - flat extra per hour during a time window
  • overtimeMultiplier({ after, factor }, opts?) - weekly overtime multiplier
  • overtimeSurcharge({ after, amount }, opts?) - weekly overtime surcharge
  • dailyOvertimeMultiplier({ after, factor }, opts?) - daily overtime multiplier
  • dailyOvertimeSurcharge({ after, amount }, opts?) - daily overtime surcharge
  • tieredOvertimeMultiplier(tiers, opts?) - multiple overtime thresholds

Example

minimizeCost()