Subject: Re: [jade-develop] Required to send an object of data from agents to agents as messages.
From: Corrado Santoro (email@example.com)
Date: Sun Dec 01 2002 - 10:18:13 MET
I had a similar problem and I solved it by serializing the object into a byte
array and then encoding the array into the content slot with the Base64 class
included in the starlight utilities (Base64.jar).
I used the following code to "encode":
ByteArrayOutputStream byte_stream = new ByteArrayOutputStream();
ObjectOutputStream object_stream = new ObjectOutputStream(byte_stream);
String enCodedString = new String(
and the following code to "decode":
ByteArrayInputStream bin = new ByteArrayInputStream(
ObjectInputStream obj_in = new ObjectInputStream(bin);
MyObject obj = (MyObject)obj_in.readObject();
I hope this will help you.
Quoting David <firstname.lastname@example.org>:
> Hi Jaders.
> I am a newbie at Jade, I hope some of you guys can help me out here.
> Have an assignment due in 48 hours time!
> I am currently building something a simple system which consists of
> buying and selling agents.
> There is a couple of information regarding the things the seller would
> like to sell.
> For instance, his selling price per unit product, quantity of sale
> products, delivery method and stuff.
> I need to build this system really fast and soon and I hope I do not
> have to implement the complex
> Ontology system ( I read about it in the programmer's guide but not sure
> if it applies to me. It all seemed complex!!).
> The ACL message only allows a string content slot. Is there a way I can
> send this object containing the wealth of
> data pertaining to the contract/agreement ? If I can send this object
> thru the ACL message, it will be much easier
> for the other party to read the necessary infor ( ie selling price,
> quantity, delivery method.etc).
> Many thanks in advance.
This mail sent through IMP: http://www.cdc.unict.it/
This archive was generated by hypermail 2a22 : Sun Dec 01 2002 - 10:24:55 MET