[rules-users] Optaplanner rule to assign employee only to shift when he/she has the skills

Wolfgang Laun wolfgang.laun at gmail.com
Fri Nov 22 08:24:10 EST 2013


See some comments (W) to the original rule.

On 22/11/2013, ns <nick.snels at ocmwturnhout.be> wrote:
> In order to make the administration simpler, I  created a table in MySQL
> that
> assigns an employee to a certain shiftType. In my code I stated that once
> an
> employee is assigned to a shiftType, he or she automatically has the skills
> needed for that shiftType, hence the skill == $shiftType part in the rule.
>
>

rule "alternativeSkill"
    when
       $assignment : ShiftAssignment($employee : employee, $shiftType
: shiftType)

W: Here we know that $employee has skill $shiftType (according to "once
an employee is assigned to a shiftType, he or she automatically has
the skills".)

       not SkillProficiency(employee == $employee, skill == $shiftType)

W: Taking "proficiency" in the usual meaning, isn't SkillProficiency(
E, S ) effectively the same proposition as ShiftAssignment( E, T )?

    then
        scoreHolder.addHardConstraintMatch(kcontext, -1);
end

W: SkillProficiency has not been explained, so it's hard to correlate
this rule with the original statement.

-W


More information about the rules-users mailing list