Hello Catherine,

In my project I use Jess in the same way. I defclass a bunch of Java objects
and create definstance facts with them. I don't know of a more efficient way
than the one you described. For accessing the Vector you'll have to create a
method getKnowledge in your class ObjectRE (public Vector getKnowledge()
{return knowledge;}). You can call this function in Jess (bind ?k (call ?obj
getKnowledge)) and voil�!

Bye,
Sander

> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On
> Behalf Of Cleder Catherine
> Sent: woensdag 17 april 2002 8:46
> To: [EMAIL PROTECTED]
> Subject: JESS: Definstance with complex objects
>
>
>
>
> Hello,
>
> I'm something like new in Jess programming and I have a question :
>
> I have a Java Class wich contains 3 attributes, a String, an
> Object from
> another Class and a Vector.
> How can I use it in Jess to create instance of this knowledge
> (for the
> initial knwoledge base)
>
> public class ObjectRE {
>
>       private String name;
>       private ActionA action ;
>       private Vector knowledge;
>
>       ...
> }
>
> and in Jess I try to use it like this :
>
> ; Defclass
> (defclass objectRE ObjectRE)
> (defclass actionA ActionA)
> (defclass knowledge Knowledge) ; for items to put in the Vector
>
> ; definitions d'instances
> (bind ?obj (new ObjectRE "lettre" (new ActionA "ind�finie"))
> (definstance objectRE ?obj dynamic)
> (call ?obj addConnaissance (new ConnaissanceRE "graphie"
> "savoir faire"
> "vide"))
>
>
> It seems to work in Jess but I'm not sure that is the most
> efficient way,
> and I don't really understand how I will access to elements
> of my Vector in
> the rules ?
>
> If anyone has some examples I will be very greatfull.
>
>       Catherine CLEDER
>       University of Clermont-Ferrand (France)
>
>
>
>
> --------------------------------------------------------------------
> 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]
> --------------------------------------------------------------------
>
>



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