Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: JADE---Sending an Concept including an concept

  1. #1
    Junior Member
    Join Date
    Nov 2012
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default JADE---Sending an Concept including an concept

    Hey Guys,

    I spend a few hours searching for an solution of my Problem. I'm now posting it here because I didn't found any solution which solved my Problem. So i hope you can help me.

    The situation is the following:

    I use Jade an I'm able to send messages. Now I try to send a Message with not only integers or strings as content but with another concept as content.

    Here I want to send a Message of the Media, which contains any number of Trackdata.

    (I left out the import and other blabla stuff cause i is working)

    In my Ontology I define:

    add(new ConceptSchema(MEDIAINFO), Mediainfo.class);
    add(new ConceptSchema(TRACKDATA), Trackdata.class);
     
    //Mediainfo
    cs = (ConceptSchema) getSchema(MEDIAINFO);
    cs.add(CURRENTTRACK, (PrimitiveSchema) getSchema(BasicOntology.INTEGER), ObjectSchema.MANDATORY);
    cs.add(TRACKINFOS, (ConceptSchema) getSchema(TRACKDATA), 1 , ObjectSchema.UNLIMITED);
     
    //Trackdata
    cs = (ConceptSchema) getSchema(TRACKDATA);
    cs.add(TRACKNUMBER, (PrimitiveSchema) getSchema(BasicOntology.INTEGER), ObjectSchema.MANDATORY);
    cs.add(TRACKTYPE, (PrimitiveSchema) getSchema(BasicOntology.STRING), ObjectSchema.MANDATORY);
    cs.add(TRACKPLAYED, (PrimitiveSchema) getSchema(BasicOntology.BOOLEAN), ObjectSchema.MANDATORY);

    Now in the Mediainfo class I define:

    public class Mediainfo implements SystemVocabulary, Concept{
     
            private Integer currentrack;
            private ArrayList<Trackdata> trackinfos;
     
     
            public void printSysteminfo(){
     
                    System.out.println("\n<<<===== Systeminfo ======>>>\n"
                                    + "\n\t Current Track: " + currenttrack
                                    + "\n\t Infos of the Trackss: " + trackinfos
                                    + "\n\n<<<===============================>>>\n"
                                    );
            }
     
            public Integer getCurrenttrack() {
                    return currenttrack;
            }
            public void setCurrenttrack (Integer currenttrack) {
                    this.currenttrack = currenttrack;
            }
     
            public ArrayList<Trackdata> getTrackinfos() {
                    return trackinfos;
            }
            public void setTrackinfos (ArrayList<Trackdata> trackinfos) {
                    this.trackinfos = trackinfos;
            }
    }

    And last but not least in an Agent I want to send a Message (the Trackdata class doesn't make any Problems i think):

    protected Mediainfo mi;
    protected Trackdata td;
     
    mi = new Systeminfo();
    mi.setCurrenttrack(2);
    ArrayList<Trackdata> track_data = new ArrayList<Trackdata>();
    td = new Trackdata();
    td.setTracknumber(1);
    td.setTracktype("rock");
    td.setTrackplayed(true);
    track_data.add(td);
    td = new Trackdata();
    td.setTracknumber(2);
    td.setTracktype("pop");
    td.setTrackplayed(false);
    track_data.add(td);
    mi.setTrackinfos(track_data);
    this.sendMessage(ACLMessage.INFORM,getAIDofService(MANAGER_SERVICE),mi);

    When I run my Programm I get the following error:

    jade.content.onto.OntologyException: No schema found for class java.util.ArrayList
    at jade.content.onto.Ontology.fromObject(Ontology.jav a:433)
    at jade.content.onto.Ontology.externalize(Ontology.ja va:698)
    at jade.content.onto.Ontology.fromObject(Ontology.jav a:645)
    at jade.content.onto.Ontology.fromObject(Ontology.jav a:654)
    at jade.content.onto.Ontology.fromObject(Ontology.jav a:427)
    at jade.content.onto.basic.Action.externalise(Action. java:71)
    at jade.content.onto.BasicOntology.fromObject(BasicOn tology.java:409)
    at jade.content.onto.Ontology.fromObject(Ontology.jav a:654)
    at jade.content.onto.Ontology.fromObject(Ontology.jav a:654)
    at jade.content.onto.Ontology.fromObject(Ontology.jav a:427)
    at jade.content.ContentManager.fillContent(ContentMan ager.java:205)
    at MAINAgents.MasterAgent.sendMessage(MasterAgent.jav a:143)
    at GUIAgents.GUIAgent.setup(GUIAgent.java:69)
    at jade.core.Agent$ActiveLifeCycle.init(Agent.java:15 22)
    at jade.core.Agent.run(Agent.java:1468)
    at java.lang.Thread.run(Thread.java:662)


    Can anybody explain to me why I get this error and how I can solve the problem?

    Regrads
    Dampfi


  2. #2
    Junior Member
    Join Date
    Nov 2012
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: JADE---Sending an Concept including an concept

    No one knows a solution?

  3. #3
    Junior Member
    Join Date
    Mar 2014
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: JADE---Sending an Concept including an concept

    Hi Dampfi,

    Now i also got some task to send the media from one agent to other agents. I am completely new to this Jade platform. If you the solution or the programs which sends the Media. Can you please share to me that would be great help to me.

    Regards,
    Gokul

Similar Threads

  1. In memory concept
    By VaniRathna in forum File I/O & Other I/O Streams
    Replies: 5
    Last Post: February 6th, 2012, 05:48 AM
  2. Help with a GUI Concept
    By UnKnown Conceptz in forum AWT / Java Swing
    Replies: 1
    Last Post: January 28th, 2012, 07:53 AM
  3. Need help with a interface concept
    By drakenlord in forum Object Oriented Programming
    Replies: 2
    Last Post: September 13th, 2011, 02:17 PM
  4. Doubt in Encapsulation concept
    By nareshn in forum Object Oriented Programming
    Replies: 1
    Last Post: January 19th, 2011, 01:20 AM
  5. [SOLVED] The concept of Server and Client
    By rendy.dev in forum Java Theory & Questions
    Replies: 3
    Last Post: January 18th, 2010, 03:13 AM