swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Try ASM2.2 (was Re: HDF5 for example


From: Paul Johnson
Subject: Try ASM2.2 (was Re: HDF5 for example
Date: Mon, 21 Jan 2002 08:23:16 -0600
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.7) Gecko/20011226

Snow Paul wrote:

> Hi!
> I am planning to use HDF5 for my swarm application to
> keep agents' data,but I am not familiar with this data
> model.Are there any examples for using it in Swarm?I
> found HDF5 in swarm.defobj.hdf5.protocol,however I
> don't know how use it.Do me a favour please!
> Best regards!
> Paul Snow
> address@hidden
> 

I tried to show hdf5 usage in the 2.2 release of the Artificial Stock
Market (http://ArtStkMkt.sourceforge.net).  I have examples of saving
time series and saving the ivars of an object (the Outcome object).

 I think the easiest usage of hdf5 is to save the time series numbers
from EZGraphs.  It is also easy to achive objects that are full of ints
and doubles and such like that. Marcus implemented that last summer and
I find it quite wonderful.

On the other hand, it is more difficult for me to use hdf5 to serialized
objects that have complicated structures. If your objects have objects
inside them, you have to save "deep" so the object saver recursively
digs through a hierarchy of classes.  It works unless you have some
pointers to dynamically allocated memory, in which case it (rightly)
can't tell what to do.

The ASM uses dynamically allocated memory in the BitVector class and so
I did not write a way to save the state of the Agents themselves. I was
supposed to do some work on that and totally forgot about it. I got an
email from one user who said that he changed the dynamic arrays to
static memory and the archiving did work.  In the ASM, as currently
written, there is no huge substantive price to pay for that change
because so much of the project is "hard coded" to use arrays of a
certain size, and making that change in order to serialize sounded fine
to me.  But I don't have more recollection of it than that, and wish the
person who checked into it would let me know how it came out.

Its something I've made a run at now and then, never crossing all the way

-- 
Paul E. Johnson                       email: address@hidden
Dept. of Political Science            http://lark.cc.ku.edu/~pauljohn
University of Kansas                  Office: (785) 864-9086
Lawrence, Kansas 66045                FAX: (785) 864-5700


                  ==================================
   Swarm-Support is for discussion of the technical details of the day
   to day usage of Swarm.  For list administration needs (esp.
   [un]subscribing), please send a message to <address@hidden>
   with "help" in the body of the message.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]