[DGD] Re: another question about clones

Bart van Leeuwen bart at wotf.org
Thu Jan 8 16:04:48 CET 2004



On Thu, 8 Jan 2004, Erwin Harte wrote:

> On Thu, Jan 08, 2004 at 12:29:54PM +0100, Bart van Leeuwen wrote:
> > On Wed, 7 Jan 2004, Par Winzell wrote:
> [...]
> > > My suggestion is that you let the master copy of the object keep track
> > > of all its clones, possibly using a mapping of mappings.
> >
> > This is workable and is what I use right now.
> > Actually, each 'master' only has to have an array of all its clones, you
> > can track all the masters with some kind of daemon still, the same daemon
> > can be used to track inheritance of course.
>
> Beware of what will happen when you have more clones of one particular
> master object than fits in status()[OST_ARRAYSIZE], which is why Par
> mentioned the mapping of mappings. :)

Well, my code checks for that (for one to allow setting an arbitrary max
on the number of clones of an object) and will use.. an array of arrays.
btw, the code originates on a lpmud, and was ported to DGD when I needed
an object manager. It currently scales to 2500^2 clones of an object, but
that can be changed at will.

The choice of mapping or array is not very relevant for this unless you
are going to use the mapping for other things then tracking clones (one
could think of using it for keeping track of how a clone was created for
example). Somehow I assumed an array to be cheaper if all I want is a
collection of clones (or alternatively a collection of collections of
clones if it no longer fits in a single array)



>
> Erwin.
> --
> Erwin Harte <harte at is-here.com>
> _________________________________________________________________
> List config page:  http://list.imaginary.com/mailman/listinfo/dgd
>
_________________________________________________________________
List config page:  http://list.imaginary.com/mailman/listinfo/dgd



More information about the DGD mailing list