<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
First you'll need a function/static method that calculates distance. I
would then determine this for ever cross product combination - make
sure this distance fact references both objects.<br>
<br>
Once you have determined all distances and inserted the facts
representing this you can "not" method a custom accumulator or possible
collect to keep retracting distance facts until you only have 10 left -
the banking example shows how to restrict on number ranges.<br>
<br>
Hopefully that should give you enough hints, when you are finished
maybe you could post the solution to the mailing list and also the wiki.<br>
<br>
Mark<br>
thomas kukofka wrote:
<blockquote
 cite="mid:d8ac9d7f0808101524waa70b45j2e6dd3b3d523d897@mail.gmail.com"
 type="cite">
  <div dir="ltr">Hello,<br>
  <br>
I have 1 Object of Type "A"<br>
with a position (x,y) and n Objects of type "B" with postions (x,y)
respectively.<br>
  <br>
I want to write a rule which gets 1 Object type "A" and more than 10
Objects of Type "B" as input facts. The rule should determine 10 of the
Objects of type "B" which are nearest to the Object of type "B".<br>
  <br>
I would appreciate any help!<br>
  <br>
Regards<br>
Thomas<br>
  </div>
  <pre wrap="">
<hr size="4" width="90%">
_______________________________________________
rules-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a>
  </pre>
</blockquote>
<br>
</body>
</html>