<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <br>
    <div class="moz-cite-prefix">Op 21-02-13 12:54, Andr&eacute; Fr&oacute;es schreef:<br>
    </div>
    <blockquote
cite="mid:CAC8f_wVwUg_efFPi9WeHwz3e6-vVxFHtR5rSLEBNhPi3nyqcYA@mail.gmail.com"
      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 style="">Example:</div>
        <div style="">Engineer Andre, WT(8 hours), Skills ABC1, ABC2</div>
        <div style=""><br>
        </div>
        <div style="">Workorder 1, required WT(2), required Skills ABC2</div>
        <div style="">Workorder 2, required WT(3), required Skills ABC2<br>
        </div>
        <div style="">Workorder 3, required WT(1), required Skills ABC1<br>
        </div>
        <div style=""><br>
        </div>
        <div style="">with these 3 WO it should work perfectly, results:</div>
        <div style="">
          <div>ID: 104[Skills: ABC 2,] &nbsp; - &nbsp; Andre(8)[Skills: ABC 1,ABC
            2,] ------ Feasible(0)</div>
          <div>ID: 105[Skills: ABC 2,] &nbsp; - &nbsp; Andre(8)[Skills: ABC 1,ABC
            2,] ------ Feasible(0)</div>
          <div>ID: 106[Skills: ABC 1,] &nbsp; - &nbsp; Andre(8)[Skills: ABC 1,ABC
            2,] ------ Feasible(0)</div>
        </div>
        <div style=""><br>
        </div>
        <div style="">Adding this workorder that exceed in time and
          skill</div>
        <div style=""><br>
        </div>
        <div style="">Workorder 1, required WT(5), required Skills ABC2,
          ABC3<br>
        </div>
        <div style=""><br>
        </div>
        <div style="">this is the outcome:</div>
        <div style=""><br>
        </div>
        <div style="">
          <div>ID: 104[Skills: ABC 2,] &nbsp; - &nbsp; Andre(8)[Skills: ABC 1,ABC
            2,] ------ Feasible(0)</div>
          <div>ID: 105[Skills: ABC 2,] &nbsp; - &nbsp; Andre(8)[Skills: ABC 1,ABC
            2,] ------ Feasible(0)</div>
          <div>ID: 107[Skills: ABC 1,ABC 3,] &nbsp; - &nbsp; Andre(8)[Skills: ABC
            1,ABC 2,] ------ Broken(1)</div>
          <div>ID: 106[Skills: ABC 1,] &nbsp; - &nbsp; Andre(8)[Skills: ABC 1,ABC
            2,] ------ Feasible(0)</div>
        </div>
      </div>
    </blockquote>
    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.<br>
    <blockquote
cite="mid:CAC8f_wVwUg_efFPi9WeHwz3e6-vVxFHtR5rSLEBNhPi3nyqcYA@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div style="">
          <div><br>
          </div>
          <div style="">it shows all not excluding the workorder that is
            not to be assigned to engineer. I did it by
            simplescorecalculator:</div>
          <div style=""><br>
          </div>
          <div style="">
            <div><span class="" style="white-space:pre"> </span>public
              HardAndSoftScore calculateScore(Distributor distributor) {</div>
            <div><span class="" style="white-space:pre"> </span>int
              hardScore = 0;</div>
            <div><span class="" style="white-space:pre"> </span>int
              softScore = 0;</div>
            <div><br>
            </div>
            <div><span class="" style="white-space:pre"> </span>for
              (Engineer e : distributor.getEngineerList()) {</div>
            <div><span class="" style="white-space:pre"> </span>int
              requiredWorktime = 0;</div>
            <div><span class="" style="white-space:pre"> </span>List&lt;Skill&gt;
              requiredSkillList = new ArrayList&lt;Skill&gt;();</div>
            <div><br>
            </div>
            <div><span class="" style="white-space:pre"> </span>for
              (WorkOrder o : distributor.getWorkOrderList()) {</div>
            <div><span class="" style="white-space:pre"> </span>if
              (e.equals(o.getEngineer())) {</div>
            <div><span class="" style="white-space:pre"> </span>requiredWorktime
              += o.getRequiredWorktime();</div>
            <div><span class="" style="white-space:pre"> </span>for
              (SkillWorkOrder swo : o.getRequiredSkills()) {</div>
            <div><span class="" style="white-space:pre"> </span>requiredSkillList.add(swo.getSkill());</div>
            <div><span class="" style="white-space:pre"> </span>}</div>
            <div><span class="" style="white-space:pre"> </span>}</div>
            <div><span class="" style="white-space:pre"> </span>}</div>
            <div><br>
            </div>
            <div><span class="" style="white-space:pre"> </span>int
              engineerAvailableTime = e.getWorktime() -
              requiredWorktime;</div>
            <div><span class="" style="white-space:pre"> </span>if
              (engineerAvailableTime &lt; 0) {</div>
            <div><span class="" style="white-space:pre"> </span>hardScore
              += engineerAvailableTime;</div>
            <div><span class="" style="white-space:pre"> </span>}</div>
            <div><br>
            </div>
            <div><span class="" style="white-space:pre"> </span>List&lt;Skill&gt;
              tempEngSkillList = new ArrayList&lt;Skill&gt;();</div>
            <div><span class="" style="white-space:pre"> </span>for
              (SkillEngineer se : e.getSkillEngineerList()){</div>
            <div><span class="" style="white-space:pre"> </span>tempEngSkillList.add(se.getSkill());</div>
            <div><span class="" style="white-space:pre"> </span>}</div>
            <div><span class="" style="white-space:pre"> </span></div>
            <div>
              <span class="" style="white-space:pre"> </span>if
              (tempEngSkillList.containsAll(requiredSkillList)){</div>
            <div><span class="" style="white-space:pre"> </span>hardScore
              += 1;</div>
            <div><span class="" style="white-space:pre"> </span>}</div>
            <div><span class="" style="white-space:pre"> </span>}</div>
            <div><br>
            </div>
            <div><span class="" style="white-space:pre"> </span>return
              DefaultHardAndSoftScore.valueOf(hardScore, softScore);</div>
            <div><span class="" style="white-space:pre"> </span>}</div>
          </div>
        </div>
        <div style=""><br>
        </div>
        <div style="">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 style=""><br>
        </div>
        <div style="">thanks for the help Geoffrey!</div>
      </div>
      <br>
    </blockquote>
    <br>
  </body>
</html>