I have created a vocabulary as Network_Vocabulary
interface
I have created a class CustomerAgentStatus
implements the AgentAction
I have then created an ontology class defining the ontology as:
I was getting an error as :
java.lang.ExceptionInitializerError
I then followed instructions as had been suggested in a similar problem as follows: http://jade.tilab.com/pipermail/jade-develop/2013q3/019284.html
Accordingly i put the
**ontology = NetworkOntology.getInstance();**
inside the setup() method and surrounded it with try/catch
After the stack Trace i got the following errors, I feel there is some error in the ontology class:
I'm getting an error as:
Java.Lang.ClassCastException: jade.content.schema.Concept Schema cannot be cast to jade .content.schema.PrimitiveSchema**
My Ontology class implementation is as follows:
package CellularNetwork;
import jade.content.onto.*;
import jade.content.schema.*;
public class Network_Ontology extends Ontology implements Network_Vocabulary {
public static final String ONTOLOGY_NAME = "Network-Ontology";
private static Ontology instance = new Network_Ontology();
public static Ontology getInstance() { return instance; }
// Private constructor
private Network_Ontology() {
super(ONTOLOGY_NAME, BasicOntology.getInstance());
try{
AgentActionSchema cs = new AgentActionSchema(CUSTOMERAGENTSTATUS);
add(cs, CustomerAgentStatus.class);
cs.add(X_CO_ORDINATE, (PrimitiveSchema) getSchema(BasicOntology.FLOAT));
cs.add(Y_CO_ORDINATE, (PrimitiveSchema) getSchema(BasicOntology.FLOAT));
cs.add(DIRECTION, (PrimitiveSchema) getSchema(BasicOntology.STRING));
cs.add(SPEED, (PrimitiveSchema) getSchema(BasicOntology.FLOAT));
cs.add(CURRENT_PROVIDER,(PrimitiveSchema) getSchema(BasicOntology.AID));
}
catch (OntologyException oe) {
oe.printStackTrace();
}
}
}// Network_Ontology