<br>&nbsp;&nbsp; Temporal reasoning was added to Drools 5 as part of the Fusion module. Not available in Drools 4.<br><br>&nbsp;&nbsp; Regarding #2, yes, you can. When I say that you need to define &quot;how close&quot; I meant Drools core does not support uncertainty reasoning out of the box, although there are some experimental research done by Davide on that.<br>
<br>&nbsp;&nbsp; []s<br>&nbsp;&nbsp; Edson<br><br><div class="gmail_quote">2009/2/20 techy <span dir="ltr">&lt;<a href="mailto:techluver007@gmail.com">techluver007@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
Thanks Edson.<br>
1.I use drools 4.X and. for &nbsp;following condition, drools gives compilation<br>
error. I&#39;m not sure what i do wrong. Some working example would help.<br>
<div class="Ih2E3d">&quot;ArrayList() from collect( Ticker( price == 20.00, timeInMillsec<br>
before[1ms,10m] 1000000 ))&quot;<br>
<br>
</div>2.If I just to want to find &quot;close&quot; ticker for given timestamp without<br>
having &quot;how close&quot;, I can think of writing some utility function in java<br>
class and use it in drools. any other idea here?<br>
<br>
Thanks again!<br>
<div><div></div><div class="Wj3C7c"><br>
<br>
Edson Tirelli-3 wrote:<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; As long as you can say &quot;how close&quot; you want using an absolute<br>
&gt; number,<br>
&gt; it is possible: let&#39;s say you want all tickers that happened up to 10<br>
&gt; minutes before a given timestamp:<br>
&gt;<br>
&gt; rule &quot;Pseudo rule&quot;<br>
&gt; when<br>
&gt; &nbsp;ArrayList() from collect( Ticker( price == 20.00, timeInMillsec<br>
&gt; before[1ms,10m] 1000000 ))<br>
&gt; then<br>
&gt; //do conseq<br>
&gt; end<br>
&gt;<br>
&gt; &nbsp; &nbsp; You can replace your timestamp (1000000) above with a Date variable or<br>
&gt; something like it.<br>
&gt;<br>
&gt; &nbsp; &nbsp; []s<br>
&gt; &nbsp; &nbsp; Edson<br>
&gt;<br>
&gt; 2009/2/17 techy &lt;<a href="mailto:techluver007@gmail.com">techluver007@gmail.com</a>&gt;<br>
&gt;<br>
&gt;&gt;<br>
&gt;&gt; I think I better more accurate info for my requirement.<br>
&gt;&gt;<br>
&gt;&gt; Is there way to get list of ( or single) Ticker that is close to given<br>
&gt;&gt; timeInMillSec and exact price value ?<br>
&gt;&gt;<br>
&gt;&gt; Class Male<br>
&gt;&gt; {<br>
&gt;&gt; &nbsp;long timeInMillsec;<br>
&gt;&gt; &nbsp;float price;<br>
&gt;&gt; &nbsp;String symbol<br>
&gt;&gt; }<br>
&gt;&gt;<br>
&gt;&gt; rule &quot;Pseudo rule&quot;<br>
&gt;&gt; when<br>
&gt;&gt; &nbsp;ArrayList() from collect( Ticker( price == 20.00 &amp;&amp; timeInMillsec is<br>
&gt;&gt; close<br>
&gt;&gt; to 1000000 ))<br>
&gt;&gt; then<br>
&gt;&gt; //do conseq<br>
&gt;&gt; end<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; Thanks.<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; techy wrote:<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; That&#39;s makes Edson. Thank you.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Is there way to to sort the facts collected using &quot;collect&quot; in LHS<br>
&gt;&gt; itself?<br>
&gt;&gt; &gt; I could not find any hint in the documentation.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Edson Tirelli-3 wrote:<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &nbsp; &nbsp;That is expected behavior.<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &nbsp; &nbsp;This is because quantifier CEs like &quot;exists&quot;, &quot;not&quot; and &quot;forall&quot;<br>
&gt;&gt; will<br>
&gt;&gt; &gt;&gt; evaluate multiple facts at once. So, if your rule has 5 foos in the<br>
&gt;&gt; &gt;&gt; working<br>
&gt;&gt; &gt;&gt; memory, which one would you expect to print?<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &nbsp; &nbsp;If you want to print each of them, remove the &quot;exists&quot;... if you<br>
&gt;&gt; want<br>
&gt;&gt; &gt;&gt; to<br>
&gt;&gt; &gt;&gt; print all of them, use &quot;collect&quot; instead of &quot;exists&quot;.<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &nbsp; &nbsp;[]s<br>
&gt;&gt; &gt;&gt; &nbsp; &nbsp;Edson<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; 2009/2/17 techy &lt;<a href="mailto:techluver007@gmail.com">techluver007@gmail.com</a>&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;&gt;<br>
&gt;&gt; &gt;&gt;&gt; I get $foo can&#39;t be resolved error for following rule. Some guidance<br>
&gt;&gt; is<br>
&gt;&gt; &gt;&gt;&gt; appreciated to reference $foo without error.<br>
&gt;&gt; &gt;&gt;&gt;<br>
&gt;&gt; &gt;&gt;&gt; Rule &quot;Foo rule&quot;<br>
&gt;&gt; &gt;&gt;&gt; when<br>
&gt;&gt; &gt;&gt;&gt; &nbsp; exists( $foo: Foo())<br>
&gt;&gt; &gt;&gt;&gt; then<br>
&gt;&gt; &gt;&gt;&gt; &nbsp;System.out.println($foo);<br>
&gt;&gt; &gt;&gt;&gt; end<br>
&gt;&gt; &gt;&gt;&gt;<br>
&gt;&gt; &gt;&gt;&gt; Thanks in advance.<br>
&gt;&gt; &gt;&gt;&gt; --<br>
&gt;&gt; &gt;&gt;&gt; View this message in context:<br>
&gt;&gt; &gt;&gt;&gt;<br>
&gt;&gt; <a href="http://www.nabble.com/error-when-referening-LHS-%3Eexists-block-var-in-RHS-tp22063253p22063253.html" target="_blank">http://www.nabble.com/error-when-referening-LHS-%3Eexists-block-var-in-RHS-tp22063253p22063253.html</a><br>

&gt;&gt; &gt;&gt;&gt; Sent from the drools - user mailing list archive at Nabble.com.<br>
&gt;&gt; &gt;&gt;&gt;<br>
&gt;&gt; &gt;&gt;&gt; _______________________________________________<br>
&gt;&gt; &gt;&gt;&gt; rules-users mailing list<br>
&gt;&gt; &gt;&gt;&gt; <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
&gt;&gt; &gt;&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
&gt;&gt; &gt;&gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; --<br>
&gt;&gt; &gt;&gt; &nbsp;Edson Tirelli<br>
&gt;&gt; &gt;&gt; &nbsp;JBoss Drools Core Development<br>
&gt;&gt; &gt;&gt; &nbsp;JBoss, a division of Red Hat @ <a href="http://www.jboss.com" target="_blank">www.jboss.com</a><br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; _______________________________________________<br>
&gt;&gt; &gt;&gt; rules-users mailing list<br>
&gt;&gt; &gt;&gt; <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
&gt;&gt; &gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt;<br>
&gt;&gt; --<br>
&gt;&gt; View this message in context:<br>
&gt;&gt; <a href="http://www.nabble.com/error-when-referening-LHS-%3Eexists-block-var-in-RHS-tp22063253p22067020.html" target="_blank">http://www.nabble.com/error-when-referening-LHS-%3Eexists-block-var-in-RHS-tp22063253p22067020.html</a><br>

&gt;&gt; Sent from the drools - user mailing list archive at Nabble.com.<br>
&gt;&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; rules-users mailing list<br>
&gt;&gt; <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
&gt;&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; &nbsp;Edson Tirelli<br>
&gt; &nbsp;JBoss Drools Core Development<br>
&gt; &nbsp;JBoss, a division of Red Hat @ <a href="http://www.jboss.com" target="_blank">www.jboss.com</a><br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; rules-users mailing list<br>
&gt; <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
&gt;<br>
&gt;<br>
<br>
--<br>
</div></div>View this message in context: <a href="http://www.nabble.com/error-when-referening-LHS-%3Eexists-block-var-in-RHS-tp22063253p22128632.html" target="_blank">http://www.nabble.com/error-when-referening-LHS-%3Eexists-block-var-in-RHS-tp22063253p22128632.html</a><br>

<div><div></div><div class="Wj3C7c">Sent from the drools - user mailing list archive at Nabble.com.<br>
<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>
</div></div></blockquote></div><br><br clear="all"><br>-- <br> &nbsp;Edson Tirelli<br> &nbsp;JBoss Drools Core Development<br> &nbsp;JBoss, a division of Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a><br>