[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: multiple attributes
From: |
Sven N. Thommesen |
Subject: |
Re: multiple attributes |
Date: |
Fri, 14 Mar 1997 16:25:59 -0600 |
At 05:12 PM 3/14/97 -0500, you wrote:
>>
>> Imagine a heatbugs-based application, but one where you want
>> a (possibly large) number of attributes for each world grid
>> site.
>>
>> Does anyone have an opinion as to what would be more efficient,
>> having multiple 'heat spaces', or coding a new kind of space
>> where each site points to a LIST of attributes (e.g. a list of
>> integers) ?
>>
>> I know the first alternative is doable (I currently have 3 spaces),
>> but slow. Has anyone made any attempts toward the second alternative?
>>
>> Sven
>>
>>
>
>Actually, I have done something like this, and put it in the
>contributed files area of the Swarm ftp site. My approach is called a
>"strattice" (for "stratified lattice"). It is basically the second of
>your alternatives. Here is the code:
>
> [snip]
Thanks! Actually, it looks more like my alternative 1, except for the
keyed access. You actually allocate a separate Grid2d for each key,
i.e. multiple 'spaces'. What I meant by my alternative 2 was a new
version of Grid2d which, instead of a single integer or id per grid
cell, would have a pointer to an ARRAY of attributes (ints, floats,
doubles) or perhaps just a pointer to a generic struct. This variant
would necessitate changes to the display code, which currently
just looks at the grid of integers.
So, anyone doing anything like this?
Sven