[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [swarm-hackers] Agents & Threads
From: |
Bill Northcott |
Subject: |
Re: [swarm-hackers] Agents & Threads |
Date: |
Mon, 16 Nov 2009 18:45:12 +1100 |
Hi Nima
As I remember it, it was a specific design goal for Swarm that simulations be
deterministic or more correctly pseudo random. Given a certain starting point
for the RNG, a given model should always follow the same path. That is the
ONLY source of randomness should be the RNG.
Once you let the path followed by the code be random it could be difficult to
separate the dynamics of the model from that of the implementation, and it is
the model you are trying to investigate.
Updating a collection of agents could still be done in multiple threads but the
outcome (for the model) must be independent of the thread completion order. It
may not be worth overhead unless the agent update is particularly expensive.
Bill
On 16/11/2009, at 3:39 PM, Nima Talebi wrote:
> Has anyone entertained the idea of having each swarm agent run as it's own
> independent thread, rather than sequentially (by which I'm also including the
> "random" mode - which shuffles the list, but then sequentially processes them
> afterwards).
>
> I know this will add more complexity to the programs, for example - an agent
> will check to see if the space it is going to move to is vacant, and by the
> time it does, it's full - but I could use locks for that kind of thing.
>
> I'm just trying to experiment with ways of making the environment as
> non-deterministic and non-discrete as possible.