well not really. If someone has a rule where they declare they want 2 objects of type A, Then most of the time, they just want the "interesting" permutations from matching objects in working memory. A hashcode is just an arbitrary way of providing an order (refer to http://www.redhillconsulting.com.au/blogs/simon/archives/000213.html <http://www.redhillconsulting.com.au/blogs/simon/archives/000213.html>for an example in SQL using an id field, which is really just as arbitrary in the database world).
I think it does need to be an option for people to use, the question is to make it default or not. It just seems that whenever someone writes rules that take multiple same type parameters, they get into trouble when they didn't really need all those extra combinations to start with. The fact that the hash code changes with each run (possibly) doesn't matter in this case, unless you magically expect certain objects to appear bound to parameters based on their order, which doesn't even make any sense anyway. In this case he was saying that he didn't need the extra combinations, and identity is a efficient way to achieve this. Michael. On 1/23/06, Peter Van Weert <[EMAIL PROTECTED]> wrote: > > Michael Neale wrote: > > Hi Andreas. > > > > The Combination monster strikes again ! > > > A monster indeed ;-) > > > Add this as your first condition: > > <java:condition>System.identityHashCode(Y) > > > System.identityHashCode (X)</java:condition> > > > > This will ensure that only "useful" combinations are added. When I add > that, > > 9 tuples took about 14milliseconds, and 20 took about 1 second (!) - > your > > mileage may vary. Before that I was getting worse times then you (my > machine > > in more humble, it would seem?). Perhaps you can confirm that this is > what > > you need? > > Personally, I doubt it. Its a difficult question to answar what are the > useful combinations. In constraint programming this translates in the > question of what to propagate. There is a lot of knowledge that can be > derived from a given knowledge base, but infering it all is in general > not a very good idea. Indeed, *every* rule that fires in this particular > test introduces redundant information. The extra constraints you are > posing on the information infered by simple transitivity here is based > on their identity hash-codes? How can that be a measure of usefulness? > Besides, every run of your program will give different (indeterministic) > results... > > But hey, that's just my idea... > > Chears, > Pé > >