|
hi, i'm trying to run this example for jade,
protege and jess, but i get the folowing error
; Oliver Hoffmann 10 May 2001
; in collaboration with Fabio Bellifemine and Ernest Friedmann-Hill ; shows how a JADE system and a JADE/JESS/PROTEGE agent can be started from within the protege JessTab ;Cargar el JessTab, permite interaccion con objetos
Protege
(load-package JessTab.JessTabFunctions) (call examples.JadeJessProtege.JessHashtable
setRete "JessProtege" (engine)) ; save the pointer to this JESS engine
(call jade.Boot main (create$ "-gui" "JessProtege:examples.JadeJessProtege.JadeJessAgent(JessProtege)")) ; start the JADE system and an agent (defclass Message ; a JADE ACL message mapped to a protege instance (is-a :STANDARD-CLASS) ; class Message will inherit th standard slots (slot Performative) ; message speech act as a String (slot Sender (type any)) ; message sender, not a String, but a JADE AID (slot Content) ; message content as a String ) (mapclass Message) ; make JESS facts for protege Message instances (defrule message ; 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 ; a new protege instance of class Message (Performative (call jade.lang.acl.ACLMessage getPerformative (?message getPerformative))) ; take the String describing the speech act (Sender (?message getSender)) ; map the sender (Content (?message getContent)) ; map the content ) (retract ?Message) ; retract the fact since it was only used to notify about the message and now we have the protege instance ) (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)) ; 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))) ; make a new java PROPOSE ACLMessage object (?message setSender (?agent getAID)) ; take "my" agent as the sender (?message addReceiver (slot-get ?instance Sender)) ; take the original sender as receiver (?message setContent (slot-get ?instance Content)) ; just copy the original content (?agent send ?message) ; send a proposal back to the original sender which is a copy of the original content ) ; the protege Message instance is still here so you can check it on the instances tab, but you might want to remove it with unmake-instance ------------ the error --------------
Jess reported an error in routine
make-instance
while executing (make-instance of Message (Performative (call jade.lang. acl.ACLMessage getPerformative (call ?message getPerformative))) (Sender (call ? message getSender)) (Content (call ?message getContent))) while executing defrule MAIN::message. Message: Incompatible type for slot: Sender type String Cannot set value: <Ext ernal-Address:jade.core.AID>. at JessTab.ProtegeMakeInstance.call(Unknown Source) at jess.FunctionHolder.call(FunctionHolder.java:30) at jess.Funcall.execute(Funcall.java:266) at jess.Defrule.fire(Defrule.java:215) at jess.Activation.fire(Activation.java:84) at jess.Agenda.run(Agenda.java:229) at jess.Agenda.run(Agenda.java:209) at jess.Rete.run(Rete.java:1132) at examples.JadeJessProtege.JadeJessBehaviour.run(JadeJessBehaviour.java :74) at examples.JadeJessProtege.JadeJessBehaviour.action(JadeJessBehaviour.j ava:87) at jade.core.behaviours.Behaviour.actionWrapper(Unknown Source) at jade.core.Agent.mainLoop(Unknown Source) at jade.core.Agent.run(Unknown Source) at java.lang.Thread.run(Unknown Source) i have tried to use
(slot Sender (type external-address:jade.core.AID))
; message sender, not a String, but a JADE AID
but it doesnt work (jade is in my
classpath)
thanks
|
- Re: JESS: Problem with slot type any Renzo Bertuzzi L.
- Re: JESS: Problem with slot type any ejfried
- JESS: 64-bit machine Raoul Jarvis
- Re: JESS: 64-bit machine ejfried
