swarm-support
[Top][All Lists]
Advanced

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

Re: DblBuffer2d


From: David Aliaga
Subject: Re: DblBuffer2d
Date: Sat, 23 Dec 2000 03:33:56 -0800 (PST)

Hi all

I was making more thinking on this subject. Please
correct me if I am wrong:

1) updateLattice swaps the pointers, AND ALSO make a
exact copy of the newly updated lattice on the new
newLattice. That means that after calling
updateLattice both lattices look the same.

2)fillWithObject nil works on the newLattice

3)To put a third agent in a random position checking
not to overwrite the position of the other ones there
are two possibilities:

 3.1) put the 2 agents, update the Lattice, then check
with the position of agent 3 and copy agent 3(in the
newLattice) BUT NOT agent 1 and 2 because they are
already there (after the updateLattice) then update
again that means two updates per time and hide it in a
method
 
  3,2) What I did. Subclass DblBuffer2d and made the
following new method:

-getObjectOnNLatticeAtX: (unsigned)x Y:(unsigned)y
{
 return *discrete2dSiteAt(newLattice,offsets,x,y);
}

and use it to test the positions. Is it safe? (My life
depends on it!)

4)To initialize I fill with nil then put the agents on
a random fasion like (3.2) and updateLattice

David

__________________________________________________
Do You Yahoo!?
Yahoo! Shopping - Thousands of Stores. Millions of Products.
http://shopping.yahoo.com/

                  ==================================
   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]