It isn't duplicates but corrupted data coming off an vehicle. There is bug in the vehicle code that isn't zeroing out memory, or updating a time value during reset procedure which causes a bunch of facts to have the same end time stamp. We cannot really change the vehicle code because it was certified by the government and it is going to be a while before another one is certified. <br>
<br><br><br><div class="gmail_quote">On Sat, Feb 25, 2012 at 1:00 AM, Wolfgang Laun <span dir="ltr"><<a href="mailto:wolfgang.laun@gmail.com">wolfgang.laun@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Would you please define unambiguously what constitutes an "invalid time"?<br>
>From your code it would appear that one time has to occur fivefold or<br>
more often to<br>
be "invalid".<br>
<br>
In case any duplicates should be removed a simple high-priority rule<br>
is sufficient:<br>
<br>
rule killDuplicate<br>
salience 1000<br>
when<br>
$f1: Fact()<br>
$f2 :Fact( endTime == $f1.endTime )<br>
then<br>
retract( $f2 );<br>
end<br>
<br>
-W<br>
<div><div class="h5"><br>
<br>
<br>
<br>
On 24/02/2012, Benjamin Bennett <<a href="mailto:benbennett@gmail.com">benbennett@gmail.com</a>> wrote:<br>
> Trying to figure out if it can be done in a rule almost some sort of pre<br>
> rule before other rules are triggered.<br>
><br>
> The current rule I have is<br>
><br>
> rule "RemoveInvalidEndTimestamps"<br>
> salience 100<br>
><br>
> when<br>
><br>
> $factN : Fact()<br>
> $factsToRemove : ArrayList(size>=5)<br>
> from collect( Fact(endTime==$factN.endTime))<br>
> then<br>
> List newFactsToRemove = new ArrayList();<br>
> newFactsToRemove.addAll($factsToRemove);<br>
> for(Fact n : newFactsToRemove ){<br>
> retract(n);<br>
> }<br>
> end<br>
><br>
> I am using a cloud based process . I could sort the facts and stream them<br>
> in.<br>
> Just in a few test cases there are many facts with invalid times , which<br>
> kills the speed .<br>
> >From the log I think that each collection of size>=5 , is triggered which<br>
> means triggered for 5,6,7, etc.<br>
><br>
> Just wondering if there is way to say before doing any other rules collect<br>
> up all these invalid times and remove them.<br>
><br>
> I was just going to write up a some java code and filter before feeding<br>
> facts into drools but I find the rule syntax is much easier to read for the<br>
> non software developers in my group.<br>
><br>
><br>
> --<br>
> Thanks,<br>
><br>
> Benjamin Bennett<br>
><br>
</div></div>> <<a href="mailto:benbennett@gmail.com">benbennett@gmail.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>
</blockquote></div><br><br clear="all"><br>-- <br>Sincerely,<br><br>Benjamin Bennett<br>314.246.0645<br><a href="mailto:benbennett@gmail.com" target="_blank">benbennett@gmail.com</a><br><br>"For a successful technology, reality must take precedence over public relations, for Nature cannot be fooled."<br>
Richard Feynman<br>