I think Bob Stewart wrote:
> try
> {
>   Rete r = new Rete();
>   r.executeCommand("(watch all)");
>   r.executeCommand("(batch /home/rmstew1/jessRules)");
>   Fact fact2 = new Fact("a bob stewart", r);

The argument to the Fact constructor is just the "head" of the fact,
not all the slot data; you have to add the slot data manually
afterwards (see sections 4.7.1 - 4.7.3 in the Jess 6.0a8 manual.)
So although you want a fact ("a" "bob" "stewart") you've instead
created a fact ("a bob stewart"). So you want something like

      Fact fact2 = new Fact("a", r);
      ValueVector vv = new ValueVector();
      vv.add(new Value("bob", RU.ATOM));
      vv.add(new Value("stewart", RU.ATOM));
      fact2.setSlotValue("__data", new Value(vv, RU.LIST));

Of course, r.executeCommand("(assert (a bob stewart))") works too.

>   r.assert(fact2);
>   r.executeCommand("(reset)");

Note that reset clears all the facts on the fact-list, including the
one you've asserted just above! Call reset before asserting your
facts.

>   r.executeCommand("(run)");
> }
> catch (JessException je)
> {
>   je.printStackTrace();
> }

---------------------------------------------------------
Ernest Friedman-Hill  
Distributed Systems Research        Phone: (925) 294-2154
Sandia National Labs                FAX:   (925) 294-2234
Org. 8920, MS 9012                  [EMAIL PROTECTED]
PO Box 969                  http://herzberg.ca.sandia.gov
Livermore, CA 94550

---------------------------------------------------------------------
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]
---------------------------------------------------------------------

Reply via email to