Hi everyone,

To get used to Jess, I have been executing commands at the Jess
prompt, and then trying the same commands using the API.

After doing all the usual things (new rete engine, creating a
deftemplate, populating the slots and adding the template) everything
works fine when asserting a particular fact using executeCommand - and
my rule fires. However, when I try and assert the fact using the API
(same slot values, head name etc.), the rule does not fire.

This code works:
engine.executeCommand("(assert (conventionalAddress (number_prefix
NIL) (street_number 48) (street_name Marlow) (street_type Street)
(suburb_name Wembley) (city_name Perth) (state_name WA) (post_code
6014) ))");

but the API equivalent does not:
Fact f = new Fact("conventionalAddress", engine);
f.setSlotValue("number_prefix", new Value("", RU.STRING) );
f.setSlotValue("street_number", new Value("48", RU.STRING) );
f.setSlotValue("street_name", new Value("Marlow", RU.STRING) );
f.setSlotValue("street_type", new Value("Street", RU.STRING) );
f.setSlotValue("suburb_name", new Value("Wembley", RU.STRING) );
f.setSlotValue("city_name", new Value("Perth", RU.STRING) );
f.setSlotValue("state_name", new Value("WA", RU.STRING) );
f.setSlotValue("post_code", new Value("6014", RU.STRING) );
engine.assertFact(f);

Regardless of which is used, this is the rule I'm trying to fire:
engine.executeCommand("(defrule find-suburb (conventionalAddress
(post_code 6014) (suburb_name ?s) ) => (store RESULT ?s ) )");

I just can't see how the fact is any different when done via the API!


Thanks, and I hope I haven't been posting the mailing list too much. (!)
Best wishes,
Matt




-- 
Matthew Hutchinson
Ph.D. Candidate

Department of Spatial Sciences
Curtin University of Technology
GPO Box U1987
Perth, Western Australia 6845

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