Solver as a Service
Sign Up Now →Sign Up Now

Milestone 5: add hours and preferences

Preview

Hard working-time rule:

contract: entity_load_max
parameters:
  day_attribute: day
  load_attribute: duration_hours
  limit_attribute: max_hours

Soft preference rule:

contract: assigned_in_entity_set
parameters:
  group_attribute: id
  entity_attribute: acceptable_shift_ids

Give the preference rule type: soft and a measured weight. Keep the hours rule hard. A user preference should influence which legal plan wins; it should not make an illegal schedule legal.

The three tiers are:

Tier Meaning Retail examples
eligibility Impossible pair; remove it before search Missing required skill, unavailable employee, employee in two places
hard Physically possible but unacceptable; a feasible answer has no violation Coverage floor, maximum hours, required rest
soft A preference with a relative price Preferred shifts, fairness, avoiding undesirable closes

Weights only have meaning relative to sibling soft rules. Sweep them against a fixed dataset and inspect every score band. A weight change that moves nothing is evidence to investigate, not permission to add a special-case assignment.