Re: JESS: Jess DE JSR-94

2005-10-05 Thread ejfried
I think erich.oliphant wrote:
 Hi,
 We are using the JSR-94 interface but would like to use JessDE for
 debugging,etc.  Will jessDE support the XML formatted files required by the
 JSR-94 interface ?

There are two JSR94 drivers. There's the reference implementation that
comes with the JSR94 package from Sun. It only supports a weird XML
rule format in which Jess language code is wrapped with XML
tags. This driver works with Jess 6 and I do not encourage anyone to
use it. It was just a proof-of-concept.

There also the new JSR94 driver that is packaged with recent versions
of Jess 7. It supports JessML *and* Jess language code. In fact, the
example given in the manual show it being used with Jess language
code, not JessML. If you're using the JessDE, then you'll need to use
this new Jess 7 driver.

So tell me where you got the idea that JessML was required if you were
using javax.rules? I'd like to change it if I can to make it clear
that it's not.

-
Ernest Friedman-Hill  
Advanced Software Research  Phone: (925) 294-2154
Sandia National LabsFAX:   (925) 294-2234
PO Box 969, MS 9012 [EMAIL PROTECTED]
Livermore, CA 94550 http://herzberg.ca.sandia.gov


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]




Re: JESS: Problem with definstance

2005-10-05 Thread ejfried
I think David Firmin wrote:

 I'm trying to create shadow facts that subclass a deftemplate that's
 already been added to the Rete. When I try and add the java bean using
 definstance I get a ClassCastException as follows:
 
 java.lang.ClassCastException
   at jess.DefinstanceList.createNewShadowFact(DefinstanceList.java:206)
   at jess.DefinstanceList.definstance(DefinstanceList.java:275)

Jess is assuming that the given class looks like a subclass of the
deftemplate -- i.e., if the template has slots foo and bar, then the
class had better have getFoo() and getBar() methods. It can have
additional properties as well, of course, as befits a subclass.

In any case, this is a lousy error message -- Jess should explicitly
detect and report this problem.


-
Ernest Friedman-Hill  
Advanced Software Research  Phone: (925) 294-2154
Sandia National LabsFAX:   (925) 294-2234
PO Box 969, MS 9012 [EMAIL PROTECTED]
Livermore, CA 94550 http://herzberg.ca.sandia.gov


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]




JESS: Firing on subsets (again)

2005-10-05 Thread Jerome Butchergreen
Hey guys I tried your advise but was unsuccessful.
Alan, I really thought your method would do exactly
what I was trying to accomplish, but I thought that
you were saying to assert that line ...as opposed to
the '?' being in the rule itself. Here's what I'm
trying to do:
(MAIN::webservice
(service getaddress)
(project sage)
(org georgetown)
(analystname blake)
(analystrole lead)
(priority low)
(reldatetime within_an_hour)
(location dc)
(action run)
)

(defrule run-service
   ?inputservice - Hey guys I tried your advise but
was unsuccessful.
Alan, I really thought your method would do exactly
what I was trying to accomplish, but I thought that
you were saying to assert that line ...as opposed to
the '?' being in the rule itself. Here's what I'm
trying to do:

(MAIN::webservice
(service getaddress)
(project sage)
(org georgetown)
(analystname blake)
(analystrole lead)
(priority low)
(reldatetime within_an_hour)
(location dc)
(action run)
)

(defrule run-service
   ?inputservice - (inputservice ?service ?project
?org ?analystname ?analystrole ?priority ?reldatetime
?location)
   ?newserv - (webservice (service ?service) (project
?project) (org ?org) (analystname ?analystname)
(analystrole ?analystrole) (priority ?priority)
(reldatetime ?reldatetime) (location ?location)
(action run) )
=
  (store RETURN run)
  (printout t JESS: Found an existing service = 
?service crlf)
  (printout t JESS: The user-specified action is to
run the service!  crlf)
  (retract ?inputservice))

Then assert:
(assert (inputservice getaddress sage georgetown blake
lead low within_an_hour dc))
Which obviously fires and give the desired result.
But we would like for the user to be allowed to leave
a field empty and still have this rule fire, so that
this would also fire for us:
(assert (inputservice getaddress ? georgetown ? lead
low within_an_hour dc))

This is what I thought you were saying to do Alan, but
after re-reading your post I see that the '?' is in
the rule. But if we implemented it that way, we would
have a rule like:
?inputservice - (inputservice ?service ? ? ? ? ? ? ?)
Which would be useless. So my question is, is there a
way to have this rule fire for a specific set of
values, and if some of the fields are left blank?

Just f.y.i I thought it could be done by changing the
second line of the rule to:
?newserv - (webservice (service ?service) (project
?project|nil) (org ?org|nil) (analystname
?analystname|nil) (analystrole ?analystrole|nil)
(priority ?priority|nil) (reldatetime
?reldatetime|nil) (location ?location|nil) (action
run) )

nil being the value passed from Java when the field
was left blank ...needless to say this didn't work
out.

thanks for the help guys
-Jerome BG(inputservice ?service ?project ?org
?analystname ?analystrole ?priority ?reldatetime
?location)
   ?newserv - (webservice (service ?service) (project
?project) (org ?org) (analystname ?analystname)
(analystrole ?analystrole) (priority ?priority)
(reldatetime ?reldatetime) (location ?location)
(action run) )
=
  (store RETURN run)
  (printout t JESS: Found an existing service = 
?service crlf)
  (printout t JESS: The user-specified action is to
run the service!  crlf)
  (retract ?inputservice))

Then assert:
(assert (inputservice getaddress sage georgetown blake
lead low within_an_hour dc))

Which obviously fires and give the desired result.
But we would like for the user to be allowed to leave
a field empty and still have this rule fire, so that
this would also fire for us:
(assert (inputservice getaddress ? georgetown ? lead
low within_an_hour dc))

This is what I thought you were saying to do Alan, but
after re-reading your post I see that the '?' is in
the rule. But if we implemented it that way, we would
have a rule like:
?inputservice - (inputservice ?service ? ? ? ? ? ? ?)

Which would be useless. So my question is, is there a
way to have this rule fire for a specific set of
values, and if some of the fields are left blank?

Just f.y.i I thought it could be done by changing the
second line of the rule to:
?newserv - (webservice (service ?service) (project
?project|nil) (org ?org|nil) (analystname
?analystname|nil) (analystrole ?analystrole|nil)
(priority ?priority|nil) (reldatetime
?reldatetime|nil) (location ?location|nil) (action
run) )

nil being the value passed from Java when the field
was left blank ...needless to say this didn't work
out.

thanks for the help guys
-Jerome BG



__ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com



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]




Re: JESS: Firing on subsets (again)

2005-10-05 Thread Jerome Butchergreen
Thanks again Alan and I understand what your saying,
but the fields where the blank values will be unknown.
Therefore to allow any of them to be random I would
have to make a useless rule using ? as the varible for
everything but the actual service. So even though we
would like to match to empty fields ...or some random
prechoosen value, we still need the other feilds so
that the rule won't fire on every entry.

just to help in giving you all am idea in what im
trying to do here is another try I made at it:
?newserv - (webservice (service ?service) (project
?project|?) (org ?org|?) (analystname
?analystname|?) (analystrole ?analystrole|?)
(priority ?priority|?) (reldatetime
?reldatetime|?) (location ?location|?) (action
run) )

...maybe I dont underst and the '|' operator on the
left-hand side, but I thought that meant 'or', but
this wont fire for me either.

thanks again
-Jerome BG


--- Alan Moore [EMAIL PROTECTED] wrote:

 Jerome,
 
 You can match against ordered facts like so:
 
 (defrule myRule
 (first second ? fourth fifth ? seventh)
 =
 (printout t Rule fired)
 )
 
 What this does is to match any of the following
 facts:
 
 (assert (first second dontcare fourth fifth dontcare
 seventh))
 (assert (first second anything fourth fifth here
 seventh))
 (assert (first second x fourth fifth y seventh))
 (assert (first second nil fourth fifth nil seventh))
 
 The question marks in the rule above will make the
 rule pattern match 
 facts with the specified values (e.g. first, second,
 etc.) at the 
 positions indicated and with *any* value at ordinal
 position 3 and 6. 
 In this case the question marks are unnamed
 variables that get bound to 
 whatever is at those positions in the matching
 fact(s).
 
 You could bind named variables like so:
 
 (defrule myRule
 (first second ?position3 fourth fifth ?position6
 seventh)
 =
 (printout t Rule fired - values at position 3
 and 6 are  
 ?position3 ,  ?position6)
 )
 
 I would suggest that you try a simplified version of
 your rule cut down 
 to just one or two fields and experiment with how
 the pattern matching 
 works.
 
  (defrule run-service
 ?inputservice - (inputservice ?service
 ?project
  ?org ?analystname ?analystrole ?priority
 ?reldatetime
  ?location)
 ?newserv - (webservice (service ?service)
 (project
  ?project) (org ?org) (analystname ?analystname)
  (analystrole ?analystrole) (priority ?priority)
  (reldatetime ?reldatetime) (location ?location)
  (action run) )
  =
(store RETURN run)
(printout t JESS: Found an existing service = 
  ?service crlf)
(printout t JESS: The user-specified action is
 to
  run the service!  crlf)
(retract ?inputservice))
 
 If this rule isn't firing for you and you think it
 should, try removing 
 some of the slot matches in the second pattern.
 Maybe one or more of the 
   slot values aren't *exactly* the same in both
 facts and so are 
 preventing them from matching. Start with only one
 or two slots and keep 
 adding them back until the rule stops firing. For
 example,
 
 (defrule run-service
 ?inputservice - (inputservice ?service ?project
 ?org ?analystname 
 ?analystrole ?priority ?reldatetime ?location)
 ?newserv - (webservice (service ?service)
 (action run) )
 =
(store RETURN run)
(printout t JESS: Found an existing service = 
 ?service crlf)
(printout t JESS: The user-specified action is
 to run the service!  
 crlf)
(retract ?inputservice)
 )
 
 Good luck!
 
 alan
 


 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]


 
 




__ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com



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]




Re: JESS: Central data storage for multiople Jess instances

2005-10-05 Thread ejfried
I think Bogdan Werth wrote:
[Charset iso-8859-1 unsupported, filtering to ASCII...]
 Hello everybody,
 I working on the model from the field of social simulation. I am
using RePast and Jess to make my agents think in a declarative way. At
the moment I have a separate Jess instance for every agent (300 agents
= 300 Rete instances).

Don't do that. Just use one Jess instance. Facts that are specific to
one agent should include an agent-specific identifier, and rules that
operate on these facts should take care to match them as needed to
keep the various agent's logical processes separate.


-
Ernest Friedman-Hill  
Advanced Software Research  Phone: (925) 294-2154
Sandia National LabsFAX:   (925) 294-2234
PO Box 969, MS 9012 [EMAIL PROTECTED]
Livermore, CA 94550 http://herzberg.ca.sandia.gov


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]