<div dir="ltr">Wrong result, i didn&#39;t enable the skill hard constraint there, this is the result, its the opposite of that, everything is feasible:<div><br></div><div><div>ID: 104[Skills: ABC 2,] -- Priority: P3   -   Andre(8)[Skills: ABC 1,ABC 2,] ------ Feasible(0)</div>
<div>ID: 103[Skills: ABC 1,ABC 2,ABC 3,ABC 4,] -- Priority: P1   -   Denny(8)[Skills: ABC 2,ABC 1,ABC 3,ABC 4,] ------ Feasible(0)</div><div>ID: 105[Skills: ABC 2,] -- Priority: P3   -   Andre(8)[Skills: ABC 1,ABC 2,] ------ Feasible(0)</div>
<div>ID: 102[Skills: ABC 2,] -- Priority: P4   -   Andre(8)[Skills: ABC 1,ABC 2,] ------ Feasible(0)</div><div>ID: 101[Skills: ABC 1,ABC 2,ABC 4,] -- Priority: P1   -   Richard(8)[Skills: ABC 1,ABC 2,ABC 4,] ------ Feasible(0)</div>
<div>ID: 107[Skills: ABC 1,ABC 3,] -- Priority: P4   -   Fabio(8)[Skills: ABC 3,ABC 1,] ------ Feasible(0)</div><div>ID: 106[Skills: ABC 1,] -- Priority: P6   -   Andre(8)[Skills: ABC 1,ABC 2,] ------ Feasible(0)</div><div>
ID: 108[Skills: ABC 1,ABC 4,] -- Priority: P5   -   Richard(8)[Skills: ABC 1,ABC 2,ABC 4,] ------ Feasible(0)</div><div>ID: 109[Skills: ABC 3,] -- Priority: P5   -   Fabio(8)[Skills: ABC 3,ABC 1,] ------ Feasible(0)</div>
<div>ID: 110[Skills: ABC 1,] -- Priority: P6   -   Fabio(8)[Skills: ABC 3,ABC 1,] ------ Feasible(0)</div><div>ID: 11011[Skills: ABC 1,ABC 2,ABC 3,ABC 4,] -- Priority: P6   -   Denny(8)[Skills: ABC 2,ABC 1,ABC 3,ABC 4,] ------ Feasible(0)</div>
</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/2/21 André Fróes <span dir="ltr">&lt;<a href="mailto:arfmoraes@gmail.com" target="_blank">arfmoraes@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">I forgot to mention that, if the hard constraint is broken, it breaks all the planning to.<div><br></div><div><div>ID: 104[Skills: ABC 2,] -- Priority: P3   -   Fabio(8)[Skills: ABC 3,ABC 1,] ------ Broken(1)</div>

<div>ID: 103[Skills: ABC 1,ABC 2,ABC 3,ABC 4,] -- Priority: P1   -   Andre(8)[Skills: ABC 1,ABC 2,] ------ Broken(2)</div><div>ID: 105[Skills: ABC 2,] -- Priority: P3   -   Richard(8)[Skills: ABC 1,ABC 2,ABC 4,] ------ Feasible(0)</div>

<div>ID: 102[Skills: ABC 2,] -- Priority: P4   -   Fabio(8)[Skills: ABC 3,ABC 1,] ------ Broken(1)</div><div>ID: 101[Skills: ABC 1,ABC 2,ABC 4,] -- Priority: P1   -   Denny(8)[Skills: ABC 2,ABC 1,ABC 3,ABC 4,] ------ Feasible(0)</div>

<div>ID: 107[Skills: ABC 1,ABC 3,] -- Priority: P4   -   Richard(8)[Skills: ABC 1,ABC 2,ABC 4,] ------ Broken(1)</div><div>ID: 106[Skills: ABC 1,] -- Priority: P6   -   Andre(8)[Skills: ABC 1,ABC 2,] ------ Feasible(0)</div>

<div>ID: 108[Skills: ABC 1,ABC 4,] -- Priority: P5   -   Fabio(8)[Skills: ABC 3,ABC 1,] ------ Broken(1)</div><div>ID: 109[Skills: ABC 3,] -- Priority: P5   -   Denny(8)[Skills: ABC 2,ABC 1,ABC 3,ABC 4,] ------ Feasible(0)</div>

<div>ID: 110[Skills: ABC 1,] -- Priority: P6   -   Fabio(8)[Skills: ABC 3,ABC 1,] ------ Feasible(0)</div><div>ID: 11011[Skills: ABC 1,ABC 2,ABC 3,ABC 4,] -- Priority: P6   -   Fabio(8)[Skills: ABC 3,ABC 1,] ------ Broken(2)</div>

</div><div><br></div><div>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&#39;ll see that it breaks more than one assignment</div>

</div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">2013/2/21 André Fróes <span dir="ltr">&lt;<a href="mailto:arfmoraes@gmail.com" target="_blank">arfmoraes@gmail.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<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">

<div>
2013/2/21 Geoffrey De Smet <span dir="ltr">&lt;<a href="mailto:ge0ffrey.spam@gmail.com" target="_blank">ge0ffrey.spam@gmail.com</a>&gt;</span><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div><div>

  
    
  
  <div bgcolor="#FFFFFF" text="#000000">
    <br>
    <div>Op 21-02-13 12:54, André Fróes schreef:<br>
    </div><div>
    <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&#39;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&#39;s another engineer
    available which has time (or it doesn&#39;t matter that engineers are
    overloaded)<br>
    - Leave it &quot;unassigned&quot; because you are doing &quot;over-constrained
    planning.&quot; For 6.0, planner will support &quot;nullable planner
    variables&quot;, 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&#39;s been some previous mails about this topic in this mail
    archive.<div><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&lt;Skill&gt;
              requiredSkillList = new ArrayList&lt;Skill&gt;();</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 &lt; 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&lt;Skill&gt;
              tempEngSkillList = new ArrayList&lt;Skill&gt;();</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&#39;s the problem happening, after that i&#39;ll
          start working on priority by the tip you provided in the
          previous post, but i&#39;ll try by simplescorecalculator to, i&#39;m
          not getting along (yet) with drools rules system (drl), it&#39;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></div></div><div>_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org" target="_blank">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></div></blockquote></div><br></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>