RE: [jade-develop] passing a Vector in a slotDescriptor


Subject: RE: [jade-develop] passing a Vector in a slotDescriptor
From: Caire Giovanni (Giovanni.Caire@TILAB.COM)
Date: Mon Jul 22 2002 - 10:48:10 MET DST


Hi Joseph,

The point is that when you declare a slot as PRIMITIVE then the type
must be a primitive type i.e. one of Ontology.STRING_TYPE,
Ontology.INTEGER_TYPE....).

In any case I would strongly suggest migrating to the new support for
content languages and ontologies (jade.content.xxx) that more powerful
and better documented (see the tutorial on the JADE site). The old one
is going to be deprecated in one of the next versions.

Bye

Giovanni

-----Original Message-----
From: Eze Joseph [mailto:oeze@engga.uwo.ca]
Sent: luned́ 22 luglio 2002 4.58
To: jade-develop@sharon.cselt.it
Subject: [jade-develop] passing a Vector in a slotDescriptor

Hi all,
I have little trouble passing an object of vector type in a slot
Descriptor.
I have used the Ontology.ANY_TYPE since I could not get a vector
primitive
type as follows:
 Ontology myInstance=new DefaultOntology();
..
..
..
myInstance.addRole("parcel",
  new SlotDescriptor[]{
  new
SlotDescriptor("parcelName",Ontology.PRIMITIVE_SLOT,Ontology.ANY_TYPE,On
tolo
gy.M),
  new
SlotDescriptor("Deliverloc",Ontology.PRIMITIVE_SLOT,Ontology.ANY_TYPE,On
tolo
gy.M),
  new
SlotDescriptor("Priority",Ontology.PRIMITIVE_SLOT,Ontology.ANY_TYPE,Onto
logy
.M)
  },ParcelDetail.class);

It compiles fine, but when I try to test, I get the following exception:

jade.onto.OntologyException: 4 Wrong class: the primitive slot
parcelName is
o
type class java.util.Vector, but must be a subtype of java.lang.Object.
        at
jade.onto.DefaultOntology.checkClass(DefaultOntology.java:559)
        at jade.onto.DefaultOntology.addRole(DefaultOntology.java:118)
        at ParcelOntology.initInstance(ParcelOntology.java:73)
        at ParcelOntology.<clinit>(ParcelOntology.java:55)
        at DeliveryAgent.registerWithDf(DeliveryAgent.java:218)
        at DeliveryAgent.setup(DeliveryAgent.java:117)
        at jade.core.Agent.run(Agent.java:1509)
        at java.lang.Thread.run(Unknown Source)

I will appreciate any advice.
Thanks Joseph

_______________________________________________
jade-develop mailing list
jade-develop@sharon.cselt.it
http://sharon.cselt.it/mailman/listinfo/jade-develop
UNSUBSCRIBE INSTRUCTIONS AT http://jade.cselt.it/mailing.htm#unsubscribe

====================================================================
CONFIDENTIALITY NOTICE
This message and its attachments are addressed solely to the persons
above and may contain confidential information. If you have received
the message in error, be informed that any use of the content hereof
is prohibited. Please return it immediately to the sender and delete
the message. Should you have any questions, please contact us by
replying to MailAdmin@tilab.com. Thank you
====================================================================



This archive was generated by hypermail 2a22 : Mon Jul 22 2002 - 10:49:35 MET DST