[rules-users] SimpleScoreCalculator
André Fróes
arfmoraes at gmail.com
Thu Feb 21 13:27:26 EST 2013
I forgot to mention that, if the hard constraint is broken, it breaks all
the planning to.
ID: 104[Skills: ABC 2,] -- Priority: P3 - Fabio(8)[Skills: ABC 3,ABC
1,] ------ Broken(1)
ID: 103[Skills: ABC 1,ABC 2,ABC 3,ABC 4,] -- Priority: P1 -
Andre(8)[Skills: ABC 1,ABC 2,] ------ Broken(2)
ID: 105[Skills: ABC 2,] -- Priority: P3 - Richard(8)[Skills: ABC 1,ABC
2,ABC 4,] ------ Feasible(0)
ID: 102[Skills: ABC 2,] -- Priority: P4 - Fabio(8)[Skills: ABC 3,ABC
1,] ------ Broken(1)
ID: 101[Skills: ABC 1,ABC 2,ABC 4,] -- Priority: P1 - Denny(8)[Skills:
ABC 2,ABC 1,ABC 3,ABC 4,] ------ Feasible(0)
ID: 107[Skills: ABC 1,ABC 3,] -- Priority: P4 - Richard(8)[Skills: ABC
1,ABC 2,ABC 4,] ------ Broken(1)
ID: 106[Skills: ABC 1,] -- Priority: P6 - Andre(8)[Skills: ABC 1,ABC
2,] ------ Feasible(0)
ID: 108[Skills: ABC 1,ABC 4,] -- Priority: P5 - Fabio(8)[Skills: ABC
3,ABC 1,] ------ Broken(1)
ID: 109[Skills: ABC 3,] -- Priority: P5 - Denny(8)[Skills: ABC 2,ABC
1,ABC 3,ABC 4,] ------ Feasible(0)
ID: 110[Skills: ABC 1,] -- Priority: P6 - Fabio(8)[Skills: ABC 3,ABC
1,] ------ Feasible(0)
ID: 11011[Skills: ABC 1,ABC 2,ABC 3,ABC 4,] -- Priority: P6 -
Fabio(8)[Skills: ABC 3,ABC 1,] ------ Broken(2)
every workorder fits if I remove ID 11011, and only 1 engineer can attend
that workorder, that would be Denny that has every required skill, but if
you notice here, you'll see that it breaks more than one assignment
2013/2/21 André Fróes <arfmoraes at gmail.com>
> in that case, i just want to leave it unassigned or (and) add it to a list
> of unassigned workorders, so I can get it and resort to another set of
> engineers.
>
>
> 2013/2/21 Geoffrey De Smet <ge0ffrey.spam at gmail.com>
>
>>
>> Op 21-02-13 12:54, André Fróes schreef:
>>
>> Sure. My sorting by worktime and skills is partially working, if I do my
>> planning with a certain number of engineers/workorders that fits in each
>> other, it works perfectly, If i overcome that, it breaks the planning, it
>> keeps showing the data that shouldn't be displayed and, in consequence,
>> breaks the optimal solution.
>>
>> Example:
>> Engineer Andre, WT(8 hours), Skills ABC1, ABC2
>>
>> Workorder 1, required WT(2), required Skills ABC2
>> Workorder 2, required WT(3), required Skills ABC2
>> Workorder 3, required WT(1), required Skills ABC1
>>
>> with these 3 WO it should work perfectly, results:
>> ID: 104[Skills: ABC 2,] - Andre(8)[Skills: ABC 1,ABC 2,] ------
>> Feasible(0)
>> ID: 105[Skills: ABC 2,] - Andre(8)[Skills: ABC 1,ABC 2,] ------
>> Feasible(0)
>> ID: 106[Skills: ABC 1,] - Andre(8)[Skills: ABC 1,ABC 2,] ------
>> Feasible(0)
>>
>> Adding this workorder that exceed in time and skill
>>
>> Workorder 1, required WT(5), required Skills ABC2, ABC3
>>
>> this is the outcome:
>>
>> ID: 104[Skills: ABC 2,] - Andre(8)[Skills: ABC 1,ABC 2,] ------
>> Feasible(0)
>> ID: 105[Skills: ABC 2,] - Andre(8)[Skills: ABC 1,ABC 2,] ------
>> Feasible(0)
>> ID: 107[Skills: ABC 1,ABC 3,] - Andre(8)[Skills: ABC 1,ABC 2,] ------
>> Broken(1)
>> ID: 106[Skills: ABC 1,] - Andre(8)[Skills: ABC 1,ABC 2,] ------
>> Feasible(0)
>>
>> What do you want to happen with that extra workorder ID: 107[Skills: ABC
>> 1,ABC 3,]?
>> - Assign it to different engineer - because there's another engineer
>> available which has time (or it doesn't matter that engineers are
>> overloaded)
>> - Leave it "unassigned" because you are doing "over-constrained
>> planning." For 6.0, planner will support "nullable planner variables", but
>> in 5.5, you need to emulate this behavior by creating special Engineer
>> called Unassigned and adjusting your score constraints to not trigger when
>> that UnassignedEngineer is involved. There's been some previous mails about
>> this topic in this mail archive.
>>
>>
>> it shows all not excluding the workorder that is not to be assigned to
>> engineer. I did it by simplescorecalculator:
>>
>> public HardAndSoftScore calculateScore(Distributor distributor) {
>> int hardScore = 0;
>> int softScore = 0;
>>
>> for (Engineer e : distributor.getEngineerList()) {
>> int requiredWorktime = 0;
>> List<Skill> requiredSkillList = new ArrayList<Skill>();
>>
>> for (WorkOrder o : distributor.getWorkOrderList()) {
>> if (e.equals(o.getEngineer())) {
>> requiredWorktime += o.getRequiredWorktime();
>> for (SkillWorkOrder swo : o.getRequiredSkills()) {
>> requiredSkillList.add(swo.getSkill());
>> }
>> }
>> }
>>
>> int engineerAvailableTime = e.getWorktime() - requiredWorktime;
>> if (engineerAvailableTime < 0) {
>> hardScore += engineerAvailableTime;
>> }
>>
>> List<Skill> tempEngSkillList = new ArrayList<Skill>();
>> for (SkillEngineer se : e.getSkillEngineerList()){
>> tempEngSkillList.add(se.getSkill());
>> }
>> if (tempEngSkillList.containsAll(requiredSkillList)){
>> hardScore += 1;
>> }
>> }
>>
>> return DefaultHardAndSoftScore.valueOf(hardScore, softScore);
>> }
>>
>> that's the problem happening, after that i'll start working on priority
>> by the tip you provided in the previous post, but i'll try by
>> simplescorecalculator to, i'm not getting along (yet) with drools rules
>> system (drl), it's a bit harder to use it with planner.
>>
>> thanks for the help Geoffrey!
>>
>>
>>
>> _______________________________________________
>> rules-users mailing list
>> rules-users at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/rules-users
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20130221/bae02fc8/attachment-0001.html
More information about the rules-users
mailing list