Good Day!

 

I am working on a Project, where I need to combine Jess with Jade and
Protégé. The problem is, I am having big troubles with the JessDE eclipse
Plug-in, as soon as I use some Protégé functions.

 

Editing regular jess code works absolutely fine, but when I edit code, that
uses Protégé or JessTab functions, like the following code, eclipse starts
using 99% of my CPU capacity and eventually freezes completely. This happens
after about 1 min of editing and there is no error message.

This error accurse only while editing the file. Reading or executing it
works absolutely fine.

 

I experienced the same effect on two different machines, one running Windows
2000, the other running SuSE Linux. I am using Eclipse SDK Version: 3.2.2,
Jess 7.0p1, JessTab 16 and Protégé 3.2.1.

 

Any help is highly appreciated!

 

Christoph Ebm

 

 

P.S.: Code, that makes trouble:

(watch all)

(load-package se.liu.ida.JessTab.JessTabFunctions)

 

(defclass Message_class ; a JADE ACL message mapped to a protege instance

  (is-a :STANDARD-CLASS) ; class Message will inherit the standard slots

  (slot Performative) ; get integer repesenting the type of message as
defined in jade.lang.acl.ACLMessage

  (slot Sender (type any)) ; message sender, not a String, but a JADE AID

  (slot Content) ; message content as a String

)

 

(mapclass Message_class)

  

(defrule message_rule ; make a protege instance for every message the agent
tells JESS about

  ?Message <- (Message ?message) ; the agent made this JESS fact for a
message it received

  =>

  (make-instance of Message_class ; a new protege instance of class Message

    (Performative (call jade.lang.acl.ACLMessage getPerformative (?message
getPerformative)))

    (Sender (call (call ?message getSender) getName))

    (Content (call ?message getContent))

  )

  (retract ?Message)

)

 

(defrule proposal ; example for what the agent could do with a message

  (Agent ?agent) ; the agent started with the JADE system

  ?instance <- (object) ; any protege instance would match here

  (test (eq (class ?instance) Message_class)) ; if the instance is a Message

  (test (eq (slot-get ?instance Performative) "CFP")) ; meaning the message
is a call for proposals

  =>

  (bind ?message (new jade.lang.acl.ACLMessage (get-member
jade.lang.acl.ACLMessage PROPOSE)))

  (?message setSender (?agent getAID)) ; take "my" agent as the sender

  (?message addReceiver (new jade.core.AID (slot-get ?instance Sender)
TRUE))

  (?message setContent (slot-get ?instance Content)) ; just copy the
original content

  (?agent send ?message)

)

 

Reply via email to