Subject: passing a Vector in a slotDescriptor
From: Eze Joseph (oeze@engga.uwo.ca)
Date: Mon Jul 22 2002 - 04:57:35 MET DST
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,Ontolo
gy.M),
new
SlotDescriptor("Deliverloc",Ontology.PRIMITIVE_SLOT,Ontology.ANY_TYPE,Ontolo
gy.M),
new
SlotDescriptor("Priority",Ontology.PRIMITIVE_SLOT,Ontology.ANY_TYPE,Ontology
.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
This archive was generated by hypermail 2a22 : Mon Jul 22 2002 - 04:57:50 MET DST