I'm new at jess-programming and need some advice. I have got following problem:
code:
(defrule find-near-ObjX
(ObjX
(ID ?ID_ObjX1)
(UID1 ?UID1_ObjX1)
(UID2 ?UID2_ObjX1)
(time ?time_ObjX1)
(Geo ?geo_ObjX1))
(ObjX
(ID ?ID_ObjX2)
(UID1 ?UID1_ObjX2)
(UID2 ?UID2_ObjX2)
(time ?time_ObjX2)
(Geo ?geo_ObjX2))
(test (not (eq ?ID_ObjX1 ?ID_ObjX2)))
(test (< (distance ?geo_ObjX1 ?geo_ObjX2) 30))
=>
(printout t "The objects "?ID_ObjX1 " and " ?ID_ObjX2 " have a distance of " (distance ?geo_ObjX1 ?geo_ObjX2) crlf))
The rule fires twice when there are two different facts of type ObjX who satisfy the pattern, for example:
the facts (ObjX (ID gen0) ...) and (ObjX (ID gen1) ...) are present in the fact-base. The output is then:
"The objects gen0 and gen1 have a distance of 20"
"The objects gen1 and gen0 have a distance of 20"
I'd like to have the rule fire only once for one pair of facts. How can i achieve this?
Thanks for help,
Johannes Echterhoff-------------------------------------------------------------------- To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]' in the BODY of a message to [EMAIL PROTECTED], NOT to the list (use your own address!) List problems? Notify [EMAIL PROTECTED] --------------------------------------------------------------------
