<br> Temporal reasoning was added to Drools 5 as part of the Fusion module. Not available in Drools 4.<br><br> Regarding #2, yes, you can. When I say that you need to define "how close" 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> []s<br> Edson<br><br><div class="gmail_quote">2009/2/20 techy <span dir="ltr"><<a href="mailto:techluver007@gmail.com">techluver007@gmail.com</a>></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 following condition, drools gives compilation<br>
error. I'm not sure what i do wrong. Some working example would help.<br>
<div class="Ih2E3d">"ArrayList() from collect( Ticker( price == 20.00, timeInMillsec<br>
before[1ms,10m] 1000000 ))"<br>
<br>
</div>2.If I just to want to find "close" ticker for given timestamp without<br>
having "how close", 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>
><br>
> As long as you can say "how close" you want using an absolute<br>
> number,<br>
> it is possible: let's say you want all tickers that happened up to 10<br>
> minutes before a given timestamp:<br>
><br>
> rule "Pseudo rule"<br>
> when<br>
> ArrayList() from collect( Ticker( price == 20.00, timeInMillsec<br>
> before[1ms,10m] 1000000 ))<br>
> then<br>
> //do conseq<br>
> end<br>
><br>
> You can replace your timestamp (1000000) above with a Date variable or<br>
> something like it.<br>
><br>
> []s<br>
> Edson<br>
><br>
> 2009/2/17 techy <<a href="mailto:techluver007@gmail.com">techluver007@gmail.com</a>><br>
><br>
>><br>
>> I think I better more accurate info for my requirement.<br>
>><br>
>> Is there way to get list of ( or single) Ticker that is close to given<br>
>> timeInMillSec and exact price value ?<br>
>><br>
>> Class Male<br>
>> {<br>
>> long timeInMillsec;<br>
>> float price;<br>
>> String symbol<br>
>> }<br>
>><br>
>> rule "Pseudo rule"<br>
>> when<br>
>> ArrayList() from collect( Ticker( price == 20.00 && timeInMillsec is<br>
>> close<br>
>> to 1000000 ))<br>
>> then<br>
>> //do conseq<br>
>> end<br>
>><br>
>><br>
>> Thanks.<br>
>><br>
>><br>
>> techy wrote:<br>
>> ><br>
>> > That's makes Edson. Thank you.<br>
>> ><br>
>> > Is there way to to sort the facts collected using "collect" in LHS<br>
>> itself?<br>
>> > I could not find any hint in the documentation.<br>
>> ><br>
>> ><br>
>> ><br>
>> > Edson Tirelli-3 wrote:<br>
>> >><br>
>> >> That is expected behavior.<br>
>> >><br>
>> >> This is because quantifier CEs like "exists", "not" and "forall"<br>
>> will<br>
>> >> evaluate multiple facts at once. So, if your rule has 5 foos in the<br>
>> >> working<br>
>> >> memory, which one would you expect to print?<br>
>> >><br>
>> >> If you want to print each of them, remove the "exists"... if you<br>
>> want<br>
>> >> to<br>
>> >> print all of them, use "collect" instead of "exists".<br>
>> >><br>
>> >> []s<br>
>> >> Edson<br>
>> >><br>
>> >> 2009/2/17 techy <<a href="mailto:techluver007@gmail.com">techluver007@gmail.com</a>><br>
>> >><br>
>> >>><br>
>> >>> I get $foo can't be resolved error for following rule. Some guidance<br>
>> is<br>
>> >>> appreciated to reference $foo without error.<br>
>> >>><br>
>> >>> Rule "Foo rule"<br>
>> >>> when<br>
>> >>> exists( $foo: Foo())<br>
>> >>> then<br>
>> >>> System.out.println($foo);<br>
>> >>> end<br>
>> >>><br>
>> >>> Thanks in advance.<br>
>> >>> --<br>
>> >>> View this message in context:<br>
>> >>><br>
>> <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>
>> >>> 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>
>> >>><br>
>> >><br>
>> >><br>
>> >><br>
>> >> --<br>
>> >> Edson Tirelli<br>
>> >> JBoss Drools Core Development<br>
>> >> JBoss, a division of Red Hat @ <a href="http://www.jboss.com" target="_blank">www.jboss.com</a><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>
>> >><br>
>> >><br>
>> ><br>
>> ><br>
>><br>
>> --<br>
>> View this message in context:<br>
>> <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>
>> 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>
>><br>
><br>
><br>
><br>
> --<br>
> Edson Tirelli<br>
> JBoss Drools Core Development<br>
> JBoss, a division of Red Hat @ <a href="http://www.jboss.com" target="_blank">www.jboss.com</a><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>
><br>
><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> Edson Tirelli<br> JBoss Drools Core Development<br> JBoss, a division of Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a><br>