Solver as a Service
Sign Up Now →Sign Up Now

Milestone 3: add skills

Preview

The retailer now says that the opener needs a key-holder. Add skills to staff, a required skill to every shift, and one eligibility rule:

contract: assigned_in_entity_set
parameters:
  group_attribute: required_skill
  entity_attribute: skills

In the full manifest this rule has a stable identifier and user-facing text:

skill_match:
  name: "Required skill"
  description: "The employee must hold the skill required by the shift."
  type: eligibility
  default_enabled: true
  contract: assigned_in_entity_set
  parameters:
    group_attribute: required_skill
    entity_attribute: skills

Update the data:

{
  "staff": [
    {"id": "alice", "skills": ["sales", "key_holder"]},
    {"id": "ben", "skills": ["sales"]}
  ],
  "shifts": [
    {"id": "mon-open", "required_skill": "key_holder"},
    {"id": "mon-close", "required_skill": "sales"}
  ]
}

Eligibility is stronger than a large penalty. An ineligible pair is removed before search, so the optimizer never “chooses” an unqualified employee because another objective was expensive.