Thanks very much for this detailled anbwser.<br>this helps me much.<br><br>I am currently playing with Drools, and trying to build rules in Java from my own Rule objects, with the help of the lang.api.<div><br></div><div>Here are some comments in the flow of your anwsers</div>

<div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im"><br>
&gt; The optimizer takes as input (among others) a list of forbiden allocations<br>
&gt; that should be generated based on some user-provided rules.<br>
<br>
</div>to me you mean &quot;generating an allocation plan&quot;.<br>
drools-planner is for you, especially if your users want to define more complex rules.</blockquote><div><br></div><div>Actually, there is a optimization-team that already worked on that and came up with their own solution. </div>

<div>They also evaluated Drool-planner for the &quot;planning&quot; part but went another direction for several reasons.<br><br>I am only working here into transforming the complex user-filled rules into &quot;forbid&quot; pairs as an input </div>

<div>to the optimizer.<br><br></div><div>I might use drools-planner for this.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">and here it sounds like a service that has a stream to consume ?<br>


then just write rules, put a session in a separate thread, and send him your stream as input.<br>
You can even use drools-fusion time operators.<br></blockquote><div><br></div><div>No a stream, but yes, this is a service that will stay up and act as a method : </div><div>Return the list of forbids for a given list of activities and resources.</div>

<div>I will pretty much build a knowledge base, and then, from time to time, feed it with data, fire the rules and</div><div>look for forbid pairs.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div class="im">
&gt; Performance constraints<br>
&gt; Here are some rough hints about the volumetry of the problem :<br>
&gt; * 1000 activities<br>
&gt; * 200 resources<br>
&gt; * 50 rules<br>
&gt;<br>
&gt; I need the forbidden allocations to be generated in under a minute.<br>
<br>
</div>is it the due time for you plan ?<br></blockquote><div> </div><div>This is a due time, for an acceptable response time to the user.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div class="im"><br></div></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
&gt; Instead, I would try to match the resources and the activities separately<br>
&gt; on each rule (each side of the rule), and then assemble the couples that<br>
&gt; match at least one common rule.<br>
<br>
</div>RETE will do that for you<div class="im">
<br>
&gt; Also, I would add some counter on each rule that would auto increment upon<br>
&gt; each match, in order to apply first the rules that match often.</div></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
</div>If there is a session in a thread, ie maintaining its kownledge over time,<br>
RETE will do that for you, by propagating only the updates to the matching rules (forward chaining).<br></blockquote><div><br></div><div>Not sure if I get it.<br>If I have two rule A and B that may produce the same forbid pairs, I want to produce this pair only once.<br>

For that, I will use inference and produce a :</div><div><br></div><div>insert(new Forbid(ressource, activity))</div><div><br></div><div>Then, in each rule, I will check that this forbid is not already present.</div><div>

<br></div><div>So my question is :<br>Will Drools &quot;learn&quot; from preivous processings and &quot;learn&quot; that rule A matches more often than rule B ? And so will it promote A to be processed first ?<br>Even if I flush the working memory between two calls ?</div>

<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
If you speak about optimisation using local search, drools-planner will do that for you (by using the previous, may be with adding so custom moves generators).<br>
<div class="im"><br>
&gt; QuestionsIs the engine of Drools smart enought for that ? Or is he even<br>
&gt; smarter ?<br>
</div>If the point is to process forbidden associations, yes, drools can be smarter than that.<br>
I whould even say that drools shoud be used only if you want to do to more than that.</blockquote><div><br></div><div>Hmm, yes, this is the dilemma :<br>I think that, for this particular problem, I could write an algorithm myself.<br>

I am trying to understand how Drools works in its guts, to foresee if</div><div>it is a good investment for the future.<br><br></div><div>For example, we are beginning to think about neighborhood forbids, </div><div>to forbid pairs of allocations &lt;&lt;Res1, Act1&gt;, &lt;Res2, Act2&gt;&gt; ...</div>

<div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
&gt; Do you have an example of Drools being used in a similar problem with<br>
&gt; success ?<br>
</div>optim : drools-planner and its cloud balancing sample<br>
real-time stream : look at drools-fusion samples and also drools-expert doc (to get the basis of what rules can do)</blockquote><div><br></div><div>Thanks for those hints.<br>Brgds,</div><div><br></div><div>Raphael</div>

</div></div>