<div dir="ltr">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. </div><div class="gmail_extra"><br><br><div class="gmail_quote">
2013/2/21 Geoffrey De Smet <span dir="ltr"><<a href="mailto:ge0ffrey.spam@gmail.com" target="_blank">ge0ffrey.spam@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
<br>
<div>Op 21-02-13 12:54, André Fróes schreef:<br>
</div><div class="im">
<blockquote type="cite">
<div dir="ltr">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.
<div>
<br>
</div>
<div>Example:</div>
<div>Engineer Andre, WT(8 hours), Skills ABC1, ABC2</div>
<div><br>
</div>
<div>Workorder 1, required WT(2), required Skills ABC2</div>
<div>Workorder 2, required WT(3), required Skills ABC2<br>
</div>
<div>Workorder 3, required WT(1), required Skills ABC1<br>
</div>
<div><br>
</div>
<div>with these 3 WO it should work perfectly, results:</div>
<div>
<div>ID: 104[Skills: ABC 2,] - Andre(8)[Skills: ABC 1,ABC
2,] ------ Feasible(0)</div>
<div>ID: 105[Skills: ABC 2,] - Andre(8)[Skills: ABC 1,ABC
2,] ------ Feasible(0)</div>
<div>ID: 106[Skills: ABC 1,] - Andre(8)[Skills: ABC 1,ABC
2,] ------ Feasible(0)</div>
</div>
<div><br>
</div>
<div>Adding this workorder that exceed in time and
skill</div>
<div><br>
</div>
<div>Workorder 1, required WT(5), required Skills ABC2,
ABC3<br>
</div>
<div><br>
</div>
<div>this is the outcome:</div>
<div><br>
</div>
<div>
<div>ID: 104[Skills: ABC 2,] - Andre(8)[Skills: ABC 1,ABC
2,] ------ Feasible(0)</div>
<div>ID: 105[Skills: ABC 2,] - Andre(8)[Skills: ABC 1,ABC
2,] ------ Feasible(0)</div>
<div>ID: 107[Skills: ABC 1,ABC 3,] - Andre(8)[Skills: ABC
1,ABC 2,] ------ Broken(1)</div>
<div>ID: 106[Skills: ABC 1,] - Andre(8)[Skills: ABC 1,ABC
2,] ------ Feasible(0)</div>
</div>
</div>
</blockquote></div>
What do you want to happen with that extra workorder ID: 107[Skills:
ABC 1,ABC 3,]?<br>
- Assign it to different engineer - because there's another engineer
available which has time (or it doesn't matter that engineers are
overloaded)<br>
- 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.<div class="im"><br>
<blockquote type="cite">
<div dir="ltr">
<div>
<div><br>
</div>
<div>it shows all not excluding the workorder that is
not to be assigned to engineer. I did it by
simplescorecalculator:</div>
<div><br>
</div>
<div>
<div><span style="white-space:pre-wrap"> </span>public
HardAndSoftScore calculateScore(Distributor distributor) {</div>
<div><span style="white-space:pre-wrap"> </span>int
hardScore = 0;</div>
<div><span style="white-space:pre-wrap"> </span>int
softScore = 0;</div>
<div><br>
</div>
<div><span style="white-space:pre-wrap"> </span>for
(Engineer e : distributor.getEngineerList()) {</div>
<div><span style="white-space:pre-wrap"> </span>int
requiredWorktime = 0;</div>
<div><span style="white-space:pre-wrap"> </span>List<Skill>
requiredSkillList = new ArrayList<Skill>();</div>
<div><br>
</div>
<div><span style="white-space:pre-wrap"> </span>for
(WorkOrder o : distributor.getWorkOrderList()) {</div>
<div><span style="white-space:pre-wrap"> </span>if
(e.equals(o.getEngineer())) {</div>
<div><span style="white-space:pre-wrap"> </span>requiredWorktime
+= o.getRequiredWorktime();</div>
<div><span style="white-space:pre-wrap"> </span>for
(SkillWorkOrder swo : o.getRequiredSkills()) {</div>
<div><span style="white-space:pre-wrap"> </span>requiredSkillList.add(swo.getSkill());</div>
<div><span style="white-space:pre-wrap"> </span>}</div>
<div><span style="white-space:pre-wrap"> </span>}</div>
<div><span style="white-space:pre-wrap"> </span>}</div>
<div><br>
</div>
<div><span style="white-space:pre-wrap"> </span>int
engineerAvailableTime = e.getWorktime() -
requiredWorktime;</div>
<div><span style="white-space:pre-wrap"> </span>if
(engineerAvailableTime < 0) {</div>
<div><span style="white-space:pre-wrap"> </span>hardScore
+= engineerAvailableTime;</div>
<div><span style="white-space:pre-wrap"> </span>}</div>
<div><br>
</div>
<div><span style="white-space:pre-wrap"> </span>List<Skill>
tempEngSkillList = new ArrayList<Skill>();</div>
<div><span style="white-space:pre-wrap"> </span>for
(SkillEngineer se : e.getSkillEngineerList()){</div>
<div><span style="white-space:pre-wrap"> </span>tempEngSkillList.add(se.getSkill());</div>
<div><span style="white-space:pre-wrap"> </span>}</div>
<div><span style="white-space:pre-wrap"> </span></div>
<div>
<span style="white-space:pre-wrap"> </span>if
(tempEngSkillList.containsAll(requiredSkillList)){</div>
<div><span style="white-space:pre-wrap"> </span>hardScore
+= 1;</div>
<div><span style="white-space:pre-wrap"> </span>}</div>
<div><span style="white-space:pre-wrap"> </span>}</div>
<div><br>
</div>
<div><span style="white-space:pre-wrap"> </span>return
DefaultHardAndSoftScore.valueOf(hardScore, softScore);</div>
<div><span style="white-space:pre-wrap"> </span>}</div>
</div>
</div>
<div><br>
</div>
<div>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.</div>
<div><br>
</div>
<div>thanks for the help Geoffrey!</div>
</div>
<br>
</blockquote>
<br>
</div></div>
<br>_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br></blockquote></div><br></div>