0

I'm working with jade and have some agents which communicate with each other. I can design new messagetypes like for example a bookinfo (String name, float prize, boolean availible). But I can only create messages with these basic variables like in this example:

ConceptSchema cs = (ConceptSchema) getSchema(BOOKINFO);
cs.add(NAME, (PrimitiveSchema) getSchema(BasicOntology.STRING), ObjectSchema.MANDATORY);
cs.add(PRIZE, (PrimitiveSchema) getSchema(BasicOntology.FLOAT), ObjectSchema.MANDATORY);
cs.add(AVAILIBLE, (PrimitiveSchema) getSchema(BasicOntology.BOOLEAN), ObjectSchema.MANDATORY);

This is how I define the Message in the Ontology

But now I want to send an ArrayList (e.g. bookinfo (String name, float prize, arrayList authers)).

What I want is something like:

ConceptSchema cs = (ConceptSchema) getSchema(BOOKINFO);
cs.add(NAME, (PrimitiveSchema) getSchema(BasicOntology.STRING), ObjectSchema.MANDATORY);
cs.add(PRIZE, (PrimitiveSchema) getSchema(BasicOntology.FLOAT), ObjectSchema.MANDATORY);
cs.add(AUTHERS, **ObjectSchema-of-an-arrayList**, ObjectSchema.MANDATORY);

Where **ObjectSchema-of-an-arrayList** has to be defined so I can use it in the code. So I have to create an ObjectSchema for the ArrayList.

I have searched hours for this problem but didn't found any solution. Can anybody help me?

Regards Hans

Mike Causer
  • 7,676
  • 1
  • 41
  • 62
Hans Dampf
  • 67
  • 1
  • 9

1 Answers1

0

Are you able to send an Object inside a message? You could pass the ArrayList as an Object and then the receiver could cast it back to ArrayList for using. Just giving an idea since I am not fluent in jade (I used mason sometime ago).

prmottajr
  • 1,804
  • 1
  • 12
  • 22