[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Swarm-Support] Grid2d Object placement issues
From: |
Paul Johnson |
Subject: |
Re: [Swarm-Support] Grid2d Object placement issues |
Date: |
Mon, 30 Nov 2009 10:06:54 -0600 |
User-agent: |
Thunderbird 2.0.0.23 (X11/20090817) |
Williamson, Robert J wrote:
> Hey there,
>
> So here is another question, though my last question is still open for
> answers.
>
> I also need to remove
> agents from the lattice as they die, but I have not figured out how to
> do that yet. I tried over writing their last place in the lattice with
> null, but that did not seem to do the trick. I figure if I can figure
> out how to remove an Object then I can just do that before moving and my
> phantom-agent problem should be solved.
>
Look at Heatbugs example. The standard way to "remove" an object
is to put a nil on that spot.
[world putObject: nil atX: x Y: y];
In the opinion model, I use a grid that allows several agents per cell and so
moving agents is a bit more complicated.
But with a standard model like you seem to have, I expect nil is your friend
.
HTH
--
Paul E. Johnson email: address@hidden
Professor, Political Science http://pj.freefaculty.org
1541 Lilac Lane, Rm 504
University of Kansas Office: (785) 864-9086
Lawrence, Kansas 66044-3177 FAX: (785) 864-5700