<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta http-equiv="content-type" content="text/html;
      charset=ISO-8859-15">
  </head>
  <body bgcolor="#ffffff" text="#000000">
    Hi,<br>
    <br>
    I've mentioned the test case I'm working on before. It's: If a
    certain value exceeds a limit more than X times within Y
    minutes/hours, do something.<br>
      ~&gt; Count = X  ,  time = Y<br>
    <br>
    During a talk with other developers it came up that by intuition the
    men would have chosen a other approach than the women. We can not
    agree if in Drools both approaches are the same in performance or if
    one is more performant. <br>
    <blockquote>Male approach: If a new event with a limit violation is
      received, check if within the last time Y already X events with
      limit violations are contained in the knowledge base .<br>
      <br>
      Female approach: If a new event with a limit violation is
      received, check if the following events contain X events with
      limit violation. This is limited to a monitoring time of <i>maximal

      </i>Y. (If there have been X events registered, before the time Y
      is elapsed, the window will be closed right away.)<br>
    </blockquote>
    <br>
    In code with Y = 1h it would be:<br>
    Male:<br>
    <blockquote>// determine new event as $triggeringEvent<br>
      $otherEvent : Value (this before[0ms,1h] $triggeringEvent)<br>
    </blockquote>
    Female:<br>
    <blockquote>// determine event that opened the window as
      $triggeringEvent<br>
      $otherEvent : Value (this after[0ms,1h] $triggeringEvent)<br>
    </blockquote>
    <br>
    This is just a extract so that that the comments are in fact
    meaningless. The focus lies on <u>before</u> and <u>after</u>.<br>
    <br>
    <br>
    Is one solution more efficient?<br>
    <br>
    <br>
    Thanks! :)<br>
    Tina<br>
    <br>
  </body>
</html>