JESS: Put a jess output into JTextArea

2005-06-06 Thread Pedro Pinheiro
I have two classes. One for the jess code and other with a java swing GUI. I want to put the jess output (results) into JTextArea. How can i do that? Thanks!! To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECT

RE: JESS: Put a jess output into JTextArea

2005-06-06 Thread Alan Moore
This depends on what output you want to place into the JTextArea: If you want to put a value/variable holding a string into it, you can pretty much translate directly from java like so: myJTextArea.append( myStringVariable ); would then become: (?myJTextArea append ?myStringVariable) How

JESS: About grouping function in JESS

2005-06-06 Thread samuel
Dear All Is there any grouping function is JESS. For example the following rules like (deftemplate Car (alot speed) (slot name)) and I would like to write a rule in LHS to get the highest speed car. What can I do. Many thanks if your can help me. Samuel

Re: Re: JESS: nil value

2005-06-06 Thread jachoma
OK, Maybe I made a mistake but lets assume the following Jess code: (clear) (watch all) (reset) (do-backward-chaining triple) (assert (triple A B)) (defrule r2 (need-triple ?x ?y) ;(neq ?x nil) => (printout t ?x " is different than nil" crlf) ) (defrule r1

JESS: Problem when modify facts when the facts is from a java object.

2005-06-06 Thread samuel
Dear All I have created a java object /*  * Created on Jun 7, 2005  *  * To change the template for this generated file go to  * Window>Preferences>Java>Code Generation>Code and Comments  */ package test; import java.beans.PropertyChangeListener; import java.beans.PropertyChangeSupport; /**  *

Re: Re: JESS: nil value

2005-06-06 Thread ejfried
I think [EMAIL PROTECTED] wrote: > (defrule r2 > (need-triple ?x ?y) > ;(neq ?x nil) > => > (printout t ?x " is different than nil" crlf) > ) The right way to write this is (defrule r2 (need-triple ?x&~nil ?y) => (printout t ?x " is diff

Re: JESS: Problem when modify facts when the facts is from a java object.

2005-06-06 Thread ejfried
I think [EMAIL PROTECTED] wrote: > /** > * @param name The name to set. > */ > public void setName(String name) { > this.name = name; > } ... > I expected that the rule will modify the Java Object but it turn out to be > no modification at all. Your class is broken;

Re: JESS: About grouping function in JESS

2005-06-06 Thread ejfried
I think [EMAIL PROTECTED] wrote: > > (deftemplate Car (alot speed) (slot name)) > > and I would like to write a rule in LHS to get the highest speed car. > The standard way to do this is to say "There's a car, and there's no other car that's faster:" (defrule fastest-car ?c <- (Car (speed ?x

RE: JESS: Problem when modify facts when the facts is from a java object.

2005-06-06 Thread Alan Moore
Warning: HTML/RTF email - sorry for the broken mailer. I *promise* to get this fixed ASAP. There are several problems with your logic here: 1) Your rule should have triggered an endless loop of firing default-rule because the RHS modifies a fact matched on the LHS. See the Jess docs for the

JESS: Send printout output to external String

2005-06-06 Thread Pedro Pinheiro
I have this code (is not complet)... rete.executeCommand("(defrule escreve-dador" + " (dador para ?r ?q)" + " =>" + " (printout t ?r \" pode receber sangue de \" ?q \".\" crlf))"); I want to have the ?r and ?q variables into a java.la

RE: JESS: Problem when modify facts when the facts is from a java object.

2005-06-06 Thread Alan Moore
Why didn't this happen in your test? Well, this leads us to another problem which is: [alan] Sorry, this sentence should have been deleted - as Ernest pointed out, your object is not firing PropertyChangeEvents. <>

Re: JESS: Send printout output to external String

2005-06-06 Thread ejfried
I think Pedro Pinheiro wrote: > I want to have the ?r and ?q variables into a java.lang.String for > future using with a java swing GUI. > > How can i do that? Supply a Java method, and have your rule call it. Pass ?r and ?s as arguments to the method.