<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"><<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>
<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've been trying to create a rule to
plan the my workorders with higher priority first, but I'm not
bein able to.</div>
</blockquote></div>
First read up on the difference between "score weight" and "score
levels":<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
"conflictingLecturesInSamePeriod", but I'm getting lost.</div>
<div><br>
</div>
<div>Example: I'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'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 "workOrderByPriority"</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 >= $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("workOrderByPriority",
ConstraintType.NEGATIVE_SOFT, </div>
<div><span style="white-space:pre-wrap"> </span>1,</div>
<div><span style="white-space:pre-wrap"> <UNKNOWN></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'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 <UNKNOWN> is
because i'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 "workOrderByPriority"</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("workOrderByPriority",
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'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't? I noticed that in some rules, and
entire list is pointed. <br>
</div>
</div>
</div>
</blockquote>
<br></div>
"Plan according to priority" is vague, here's are some suggestions
on implementation:<br>
<br>
A)<br>
When<br>
there's unassigned workorder<br>
and there's an engineer capable of doing that workorder<br>
and the engineer has a workorder with a lower priority (use
"exists" 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'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'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>