What do you want to happen with that extra workorder ID: 107[Skills: ABC 1,ABC 3,]?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 ABC2Workorder 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)
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!