<div dir="ltr">Thanks for the explanation, that helped me a lot.</div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/2/4 Geoffrey De Smet <span dir="ltr">&lt;<a href="mailto:ge0ffrey.spam@gmail.com" target="_blank">ge0ffrey.spam@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 bgcolor="#FFFFFF" text="#000000">
    <br>
    <br>
    <div>Op 04-02-13 14:24, André Fróes schreef:<br>
    </div><div class="im">
    <blockquote type="cite">
      <div dir="ltr">Hello there. I&#39;ve been trying to create a rule to
        plan the my workorders with higher priority first, but I&#39;m not
        bein able to.</div>
    </blockquote></div>
    First read up on the difference between &quot;score weight&quot; and &quot;score
    levels&quot;:<br>
     
<a href="http://docs.jboss.org/drools/release/5.5.0.Final/drools-planner-docs/html_single/index.html#d0e3333" target="_blank">http://docs.jboss.org/drools/release/5.5.0.Final/drools-planner-docs/html_single/index.html#d0e3333</a><br>

    Does your business want to plan higher priority workitems always (=
    score level) or are there exceptions (= score weight)?<br>
    Ask them this: if you can assign 1000000 low priority tasks or only
    1 high priority task, what would you rather do?<div class="im"><br>
    <blockquote type="cite">
      <div dir="ltr">
        <div><br>
        </div>
        <div>I tried creating a rule something like
          &quot;conflictingLecturesInSamePeriod&quot;, but I&#39;m getting lost.</div>
        <div><br>
        </div>
        <div>Example: I&#39;ve implemented my previous example of
          engineer/workorders and added shitf and priority. The
          priorities goes from 1 to 5, the lowest it is, the more urgent
          it is (1-Highest, 2-High, etc..)</div>
        <div><br>
        </div>
        <div>I don&#39;t know how to compare it to the other in the
          list, so I tried checking with previous ID, but no success:</div>
        <div>******************************</div>
        <div>
          <div>rule &quot;workOrderByPriority&quot;</div>
          <div><span style="white-space:pre-wrap"> </span>when</div>
          <div><span style="white-space:pre-wrap"> </span>$leftWorkOrderPriority
            : WorkOrder($leftWOP : id, $leftPriority :
            priority.priorityID)</div>
          <div><span style="white-space:pre-wrap"> </span>$righttWorkOrderPriority
            : WorkOrder(id &gt;= $leftWOP, $rightPriority :
            priority.priorityID)</div>
          <div><span style="white-space:pre-wrap"> </span></div>
          <div><span style="white-space:pre-wrap"> </span>$engineer:
            Engineer($id : id)<span style="white-space:pre-wrap"> </span></div>
          <div><span style="white-space:pre-wrap"> </span>then</div>
          <div><span style="white-space:pre-wrap"> </span>insertLogical(new
            IntConstraintOccurrence(&quot;workOrderByPriority&quot;,
            ConstraintType.NEGATIVE_SOFT, </div>
          <div><span style="white-space:pre-wrap"> </span>1,</div>
          <div><span style="white-space:pre-wrap"> &lt;UNKNOWN&gt;</span>,
            $engineer));</div>
        </div>
      </div>
    </blockquote></div>
    makes no sense to me, especially since 1) there are no restrictions
    on engineer and 2) because it&#39;s the cause<div class="im"><br>
    <blockquote type="cite">
      <div dir="ltr">
        <div>
          <div>end</div>
          <div>*******************************</div>
          <div>this above is the second attempt, the &lt;UNKNOWN&gt; is
            because i&#39;m lost about what to add and also if i should add
            something there.<br>
          </div>
          <div><br>
          </div>
          <div>the first try just pass straight forward</div>
          <div>*******************************<br>
          </div>
          <div>
            <div>rule &quot;workOrderByPriority&quot;</div>
            <div><span style="white-space:pre-wrap"> </span>when</div>
            <div><span style="white-space:pre-wrap"> </span>$engineer
              : Engineer($worktime : worktime)</div>
            <div><span style="white-space:pre-wrap"> </span>$priority
              : WorkOrder($priorityId : priority.priorityID)</div>
            <div>
              <span style="white-space:pre-wrap"> </span>then</div>
            <div><span style="white-space:pre-wrap"> </span>insertLogical(new
              IntConstraintOccurrence(&quot;workOrderByPriority&quot;,
              ConstraintType.NEGATIVE_SOFT, </div>
            <div><span style="white-space:pre-wrap"> </span>2,</div>
            <div><span style="white-space:pre-wrap"> </span>$priority,
              $engineer));</div>
            <div>end</div>
          </div>
          <div>*******************************<br>
          </div>
          <div>
            i know i&#39;m far from get even closer. In order to define the
            planner according to priority I think I should compare it
            with entire list isn&#39;t? I noticed that in some rules, and
            entire list is pointed. <br>
          </div>
        </div>
      </div>
    </blockquote>
    <br></div>
    &quot;Plan according to priority&quot; is vague, here&#39;s are some suggestions
    on implementation:<br>
    <br>
    A)<br>
    When<br>
      there&#39;s unassigned workorder<br>
      and there&#39;s an engineer capable of doing that workorder<br>
      and the engineer has a workorder with a lower priority (use
    &quot;exists&quot; here)<br>
    then<br>
      the engineer should be doing the other workorder<br>
      -1 (with the cause being the unassigned workorder)<br>
    <br>
    B)<br>
    When<br>
       there&#39;s an unassigned workorder<br>
    then<br>
      -1 * priority * 1000 (with the cause being the unassigned
    workorder)<br>
    <br>
    HTH<br>
    <blockquote type="cite"><div class="im">
      <div dir="ltr">
        <div>
          <div>
            <br>
          </div>
          <div>I searched the guide and example for some tips,
            but the best I found was the course that compared 2 courses
            that I believe that will be the same thing i&#39;ll have to do
            with priorities.</div>
        </div>
      </div>
      <br>
      <fieldset></fieldset>
      <br>
      </div><pre>_______________________________________________
rules-users mailing list
<a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a>
</pre>
    </blockquote>
    <br>
  </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>
<br></blockquote></div><br></div>