Skip to main content
function preferAssignment(opts?): RuleEntry<"assignment-priority", object & RuleOptions>;
Nudge the solver toward scheduling targeted members.

Parameters

opts
RuleOptions

Returns

RuleEntry<"assignment-priority", object & RuleOptions> Soft constraint. The solver adds a bonus for each assignment of the targeted members, making them more likely to appear on the schedule. Use priority to control how strong the nudge is; higher priority means a larger bonus. Even at "MANDATORY" strength the solver can still leave a member unassigned if hard constraints prevent it. Opposite of avoidAssignment. Both map to the same underlying assignment-priority rule with different directions.