JESS: So lame, and so sorry - disregard last post

2005-10-10 Thread Matthew Hutchinson
Hi again,

Just worked out my own answer. I just needed to add a defclass line to my clp file, so it knew about the class!

(defclass newAddress Address) ;; new line of code
(defrule complete-address (newAddress (locality ~nil) (number ~nil)
(postCode ~nil) (state ~nil) (streetName ~nil) ) = (printout t
launching crlf) )


Sorry, it always seems like I work it out after posting, even though I
really think before posting. :-( I guess I answered my first question
from a Jess user though!

So it's not a complete waste, is the following line still the reccomended way of loading rules from Java?

engine.executeCommand((batch jess_test.clp));


Ta,
Matt


-- Matthew HutchinsonPh.D. CandidateDepartment of Spatial SciencesCurtin University of TechnologyGPO Box U1987Perth, Western Australia 6845


JESS: Loading rules from file that relate to javabeans

2005-10-10 Thread Matthew Hutchinson
G'day everyone,

I'm looking to create a java object, and monitor this via its javabeans
compatibility. Then if the object's properties meet certain criteria,
then a rule fires. I have done this with no problems using the Jess
command line, but am now interested in doing the equivalent via the
Jess API.

I understand how to do this, but have a queston regarding the storing
of rules. I want to store my rules in a .clp file, which if using the
Jess command line, i would just use (batch).
How do I create the bean complient object in Java, but ensure the rules in the .clp file know what I'm referring to?

my code for a simple java class is:

-
import jess.*;

public class JessDemo {

 public static void main(String[] args) {
  
  Rete engine = new Rete();
  try
  {
   engine.clear();
  
engine.executeCommand((batch jess_test.clp)); //this line causes an
error
   engine.defclass(address, Address, null);
   Address
inputAddress = new Address(null, null, null, null, 36,marlow,
street, wembley, wa, 6014);
   System.out.println(inputAddress.toString() );
   engine.definstance(address, inputAddress, false);
  }
  catch (JessException error) 
  {
   System.out.println(Error!);
   System.out.println(error.toString() );
  }

 }

}
--

the clp file to be used with the javabean contains:

--
(defrule complete-address (newAddress (locality ~nil) (number ~nil)
(postCode ~nil) (state ~nil) (streetName ~nil) ) = (printout t
thunderbirds are go crlf) )


any my original clp file, which i used at the jess command line, was:

(clear)
(defclass newAddress Address)
(ppdeftemplate newAddress)
(bind ?na (new Address nil nil nil nil 36 marlow street wembley wa 6014 ))
(definstance newAddress ?na static)
(reset)
(defrule complete-address (newAddress (locality ~nil) (number ~nil)
(postCode ~nil) (state ~nil) (streetName ~nil) ) = (printout t
thunderbirds are go crlf) )

obviously I typed (run), too. it worked no problems.


I know enough that because I have removed the defclass, ppdeftemplate,
bind and definstance commands from the top clp file, the rule has no
idea about what's going on...


so in a nutshell: how do you store rules in a clp file about an object that is not yet instantiated?

Cheers,
Matt



-- Matthew HutchinsonPh.D. CandidateDepartment of Spatial SciencesCurtin University of TechnologyGPO Box U1987Perth, Western Australia 6845
G'day everyone,

I'm looking to create a java object, and monitor this via its javabeans
compatibility. Then if the object's properties meet certain criteria,
then a rule fires. I have done this with no problems using the Jess
command line, but am now interested in doing the equivalent via the
Jess API.

I understand how to do this, but have a queston regarding the storing
of rules. I want to store my rules in a .clp file, which if using the
Jess command line, i would just use (batch).
How do I create the bean complient object in Java, but ensure the rules in the .clp file know what I'm referring to?

my code for a simple java class is:

-
import jess.*;

public class JessDemo {

 public static void main(String[] args) {
  
  Rete engine = new Rete();
  try
  {
   engine.clear();
  
engine.executeCommand((batch jess_test.clp)); //this line causes an
error
   engine.defclass(address, Address, null);
   Address
inputAddress = new Address(null, null, null, null, 36,marlow,
street, wembley, wa, 6014);
   System.out.println(inputAddress.toString() );
   engine.definstance(address, inputAddress, false);
  }
  catch (JessException error) 
  {
   System.out.println(Error!);
   System.out.println(error.toString() );
  }

 }

}
--

the above clp file contains:

--
(defrule complete-address (newAddress (locality ~nil) (number ~nil)
(postCode ~nil) (state ~nil) (streetName ~nil) ) = (printout t
launching crlf) )


any my original clp file, which i used at the jess command line, was:

(clear)
(defclass newAddress Address)
(ppdeftemplate newAddress)
(bind ?na (new Address nil nil nil nil 36 marlow street wembley wa 6014 ))
(definstance newAddress ?na static)
(reset)
(defrule complete-address (newAddress (locality ~nil) (number ~nil)
(postCode ~nil) (state ~nil) (streetName ~nil) ) = (printout t
launching crlf) )
 

I know enough that because I have removed the defclass, ppdeftemplate,
bind and definstance commands from the clp file, the rule has no idea
about what's going on...


so in a nutshell: how do you store rules in a clp file about an object that is not yet instantiated?

Cheers,

JESS: The JessTab PAL-integration functions are not available

2005-10-10 Thread Eunice Palmeira
Hello,
   I have a problem when i try run Jess with Protigi:

JessTab: Note that the PAL engine is not currently installed in Protege.
(The JessTab PAL-integration functions are not available.)

Somebody helpe me, please
 Eunice



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: New to JESS

2005-10-10 Thread ejfried
I think nikita berdikov wrote:
[Charset iso-8859-1 unsupported, filtering to ASCII...]
 Hello, 
 I'm new to Eclipse and JESS, so can anyone tell me how
 to start working with JESS in Eclipse 3.1. What
 variables should i set? I did everything that is
 written in Using the JessDE, but something is wrong.

What is wrong, exactly -- i.e., what did you do, what happened, and
what did you expect to happen instead? If you install it properly,
files named *.clp will be opened in the JessDE Editor; otherwise,
nothing much should be different.

 And please, show me an example of JESS code in
 Eclipse.

You can open any *.clp file in the JessDE editor; you can type in any
code in the manual, or open any *.clp files in the examples directory.

 
 Thanks in advance.
 
 
   
 __ 
 Yahoo! Music Unlimited 
 Access over 1 million songs. Try it free.
 http://music.yahoo.com/unlimited/
 
 
 
 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]
 
 



-
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: So lame, and so sorry - disregard last post

2005-10-10 Thread ejfried
I think Matthew Hutchinson wrote:
 
 So it's not a complete waste, is the following line still the reccomended
 way of loading rules from Java?
 
 engine.executeCommand((batch jess_test.clp));

In Jess 7, there's a Rete.batch() method you can use instead;
otherwise, what you've shown works fine. Another alternative is

Reader data = ... // Open file, or whatever
try {
  Jesp jesp = new Jesp(data, engine);
  jesp.parse(false);
} finally {
  data.close();
}



-
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: The JessTab PAL-integration functions are not available

2005-10-10 Thread ejfried
I think Eunice Palmeira wrote:
[Charset iso-8859-1 unsupported, filtering to ASCII...]
 Hello,
I have a problem when i try run Jess with Protigi:
 
 JessTab: Note that the PAL engine is not currently installed in Protege.
 (The JessTab PAL-integration functions are not available.)
 

Well, presumably whatever the PAL engine is needs to be
installed. This is not a Jess thing -- it must be a Protege thing.
Protege questions tend not to get answered on this list. You should
try asking this on a Protege mailing list or forum.




-
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: For-loop bug

2005-10-10 Thread ejfried
You're right -- that's not the correct behavior. Thanks for the
report.

I think Yura wrote:
[Charset koi8-r unsupported, filtering to ASCII...]
 Hi
 
 I think there is a bug in the 'for'-loop implementation. The following code 
 returns '1' (incorrect):
 
 (bind ?x 1)
 (for (bind ?i 1) ( ?i 2) (++ ?i)
   (bind ?x (float ?x))
   (printout t ?x ==  ?x crlf)
 )
 ?x
 
 When I comment out the 'for'-block the expression evaluates to '1.0' 
 (correct). I'm using 70b3.
 
 Yuri



-
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: New to JESS

2005-10-10 Thread Matthew Hutchinson
Hi,

having just started using Eclipse myself, I would suggest:

- making sure you unzipped all the correct plugins into the correct
directory
- make sure you create a new *java* project in eclipse, not any other type

cheers,
Matt



On 10/10/05, nikita berdikov [EMAIL PROTECTED] wrote:

 Hello,
 I'm new to Eclipse and JESS, so can anyone tell me how
 to start working with JESS in Eclipse 3.1. What
 variables should i set? I did everything that is
 written in Using the JessDE, but something is wrong.
 And please, show me an example of JESS code in
 Eclipse.

 Thanks in advance.



 __
 Yahoo! Music Unlimited
 Access over 1 million songs. Try it free.
 http://music.yahoo.com/unlimited/


 
 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]