-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
unsubscribe jess-users [EMAIL PROTECTED]
This communication contains information which is confidential and may
also
be privileged. It is for the exclusive use of the intended
recipient(s). If
you are not the intended recipient(s), please note that any
distribution,
copying or use of this communication or the information in it is
strictly
prohibited. If you have received this communication in error, please
notify
the sender immediately and then destroy any copies of it.
- -----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On
Behalf Of [EMAIL PROTECTED]
Sent: Monday, August 20, 2001 1:54 PM
To: Bob Stewart
Cc: [EMAIL PROTECTED]
Subject: Re: JESS: Retry- Simple Jess Question
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]
- ---------------------------------------------------------------------
-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>
iQA/AwUBO4FkVzEIm5hGlDt/EQKoXwCgz9AaswDcwu/p61fvbl+GWkAQOUoAoJLw
Tfncc/ZmirmoTU/pTbU6IZxW
=kqme
-----END PGP SIGNATURE-----
---------------------------------------------------------------------
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]
---------------------------------------------------------------------