<span lang="EN-US">Hi,</span> 

<br><div class="gmail_quote"><div class="gmail_quote"><div class="gmail_quote"><span lang="EN-US"></span><div class="gmail_quote"><div link="blue" vlink="purple" lang="NL"><div>









<p><span lang="EN-US">I’m interested in the application of
Drools in the planning and scheduling domain. In a planning application a
planner can take planning decisions and the system will determine all consequences
of the planning decision automatically and provides immediate visual
feedback of these consequences. For example, suppose that we have a number of
machines and a number of jobs and each job must be allocated to one of the
machines; the objective is to minimize the completion time of the latest job. In this case, there are two types of planning decision:
allocating a job to a machine and sequencing the jobs on each machine. <br></span></p>

<p><span lang="EN-US">I’ve been experimenting for a while
to employ Drools 5.0 to determine the consequences of the planning decisions. Many business
rules in the planning and scheduling domain are in fact calculations that
express the (declarative) dependency of an attribute of an object on the
attributes of one or more other objects. For the machine scheduling problem we
have the following business rules: </span></p>

<ul><li><span style="font-family: Symbol;" lang="EN-US"><span><span style="font-family: &quot;Times New Roman&quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"></span></span></span><span lang="EN-US">A Job must be allocated to one Machine.</span></li>



<li><span style="font-family: Symbol;" lang="EN-US"><span><span style="font-family: &quot;Times New Roman&quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"></span></span></span><span lang="EN-US">A Machine can process at most
one Job at a time.</span></li><li><span style="font-family: Symbol;" lang="EN-US"><span><span style="font-family: &quot;Times New Roman&quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"></span></span></span><span lang="EN-US">The completion time of an Allocation
is equal to the start time of the Allocation plus the processing time of the Job.</span></li><li><span style="font-family: Symbol;" lang="EN-US"><span><span style="font-family: &quot;Times New Roman&quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"></span></span></span><span lang="EN-US">An Allocation must not start
before the release date of the Job</span></li><li><span style="font-family: Symbol;" lang="EN-US"><span><span style="font-family: &quot;Times New Roman&quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"></span></span></span><span lang="EN-US">An Allocation must be completed
before or at the due date of the Job.</span></li></ul>











<p><span lang="EN-US">These rules can be formulated in Drools,
for example:</span></p>

<p><span lang="EN-US">rule
&quot;BR-ALLOCATION.COMPLETION_TIME&quot;</span></p>

<p><span lang="EN-US">                when</span></p>

<p><span lang="EN-US">                               $job :
Job($procTime : procTime)</span></p>

<p><span lang="EN-US">                               $allocation
: Allocation($startTime : startTime, job == $job)</span></p>

<p><span lang="EN-US">                then</span></p>

<p><span lang="EN-US">                               $allocation.setCompletionTime($startTime
+ $procTime);</span></p>

<p><span lang="EN-US">end</span></p>

<p><span lang="EN-US"> </span></p>

<p><span lang="EN-US">Unfortunately my approach does not scale
very well. I guess that this is related to the way in which RETE works by
keeping all possible pairs of Jobs and Allocations in memory, although each Job
is associated (object reference) with at most one Allocation. Is there any
which in which Drools can take advantage of the fact that a Job has an explicit
reference to an Allocation? Do you have any suggestions on how to improve the
performance?</span></p><p>In planning and scheduling applications it is not uncommon to have up to a million objects in the working memory.<br><span lang="EN-US"></span></p><p><span lang="EN-US">Regards,</span></p>



<p><span lang="EN-US">Robin <br></span></p>

</div></div></div><br>
</div><br>
</div><br>
</div><br>