[erlang-questions] write the ant simulation in Erlang?
Fri Oct 10 03:08:29 CEST 2008
On 10 Oct 2008, at 1:57 pm, Robert Virding wrote:
> This was to get around the problem of checking if a cell was free
> before moving into and then finding the cell has been taken.
That was understood.
> The immediate world is one cell left, center, right, so it is very
> immediate. The "spec" stated only one ant per cell.
It *happened* to be very immediate.
What about a protocol like this:
check each relevant square
choose where to go
ask the world to move you
if it refuses, try again with locking.
The old "locks are usually not contended" idea.
I think one process per cell of the world may make sense.
More information about the erlang-questions