[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
DblBuffer2d
From: |
David Aliaga |
Subject: |
DblBuffer2d |
Date: |
Fri, 22 Dec 2000 06:53:55 -0800 (PST) |
Hi Swarm Community.
some questions about DblBuffer2d just to be sure:
Here there are two spaces one for "past" the other for
"future"
"All reads take place from lattice, all writes take
place to newLattice."
1)If I have for example 2 agents on (2,4) and (3,8)
and after some calculations they move to (3,4) and
(4,8)
and I put:
[world putObject: agent1 atX: 3 Y: 4]; //.......(*)
[world putObject: agent2 atX: 4 Y: 8]; //.......(**)
what happen with the other positions? Should I put
before (*) and (**) the following:
[world fillWithObject: nil];
to make sure the other ones have nil?, and do it every
time before calling "updateLattice"? Does this
"fillWithObject" work in the newLattice? (note: this
is important because I have to make sure there is nil
ALWAYS in the place where there is no agents)
2)What happen if I have another agent let's say agent3
and I want to put it together with agent1 and agent2
but in a "random" position.(X,Y) (of course not (3,4)
nor (4,8)) Then I have to make sure that and so I nead
to "read" if there is an agent on position (X,Y) of
"The future state of the world"!!!
How can I read from newLattice?
Of course another posibility is to put the 2 agents,
update the Lattice, then check with the position of
agent 3 and copy one and two and then 3 and update
again, that means two updates per time step. Is this
the way or there is a better one?
Thanks a lot
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.
- DblBuffer2d,
David Aliaga <=