shreeparna sarkar
2014-08-27 11:35:04 UTC
- 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 your instructions as u had 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
Please help i'm really stuck. As i am not at all even able to track where
the error is, i m faltering.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://jade.tilab.com/pipermail/jade-develop/attachments/20140827/e636a30a/attachment.html>
- 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 your instructions as u had 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
Please help i'm really stuck. As i am not at all even able to track where
the error is, i m faltering.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://jade.tilab.com/pipermail/jade-develop/attachments/20140827/e636a30a/attachment.html>