<html>
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered)">
<style>
<!--
/* Font Definitions */
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:Arial;}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{color:blue;
text-decoration:underline;}
span.Typed
{font-family:"Courier New";}
span.tty
{font-family:"Courier New";}
span.Name
{font-style:italic;}
span.Variable
{font-family:"Times New Roman";
font-style:italic;}
span.EmailStyle22
{font-family:Arial;
color:navy;}
@page Section1
{size:8.5in 11.0in;
margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
{page:Section1;}
/* List Definitions */
ol
{margin-bottom:0in;}
ul
{margin-bottom:0in;}
-->
</style>
</head>
<body lang=EN-US link=blue vlink=blue>
<div class=Section1>
<p class=MsoNormal><span style='color:navy'>Actually Danny G’s approach
has merit. Ant on square A wants to move to square B. The messages passed are
quite simple:</span></p>
<p class=MsoNormal><span style='color:navy'> </span></p>
<ol style='margin-top:0in' start=1 type=1>
<li class=MsoNormal style='color:navy'>A: B ! {A, 'I have an ant who wants to
move to you'}</li>
<li class=MsoNormal style='color:navy'>B: Either:</li>
<ol style='margin-top:0in' start=1 type=a>
<li class=MsoNormal style='color:navy'>A ! 'Your ant moved here successfully'</li>
<li class=MsoNormal style='color:navy'>A ! 'No can do, mate; I’m
already occupied'</li>
</ol>
</ol>
<p class=MsoNormal><span style='color:navy'> </span></p>
<p class=MsoNormal><span style='color:navy'>In the case of 2a, square A marks
itself vacant and can now respond with its own 'Your ant moved here
successfully' message when another square requests passage for its ant. In
case of 2b, square A tries another square.</span></p>
<p class=MsoNormal><span style='color:navy'> </span></p>
<p class=MsoNormal><span style='color:navy'>DBM</span></p>
<p class=MsoNormal><span style='color:navy'> </span></p>
<p class=MsoNormal><span style='color:navy'> </span></p>
<p class=MsoNormal><span style='color:navy'> </span></p>
<div style='border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt'>
<div>
<div class=MsoNormal align=center style='text-align:center'>
<hr size=2 width="100%" align=center tabindex=-1>
</div>
<p class=MsoNormal><b><span style='font-family:Tahoma'>From:</span></b><span
style='font-family:Tahoma'> erlang-questions-bounces@erlang.org
[mailto:erlang-questions-bounces@erlang.org] <b>On Behalf Of </b>Rick R<br>
<b>Sent:</b> Friday, October 10, 2008 15:39<br>
<b>To:</b> Erlang-Questions (E-mail)<br>
<b>Subject:</b> Re: [erlang-questions] write the ant simulation in Erlang?</span></p>
</div>
<p class=MsoNormal> </p>
<div>
<p class=MsoNormal> </p>
<div>
<p class=MsoNormal>2008/10/10 Daniel Goertzen <<a
href="mailto:daniel.goertzen@gmail.com">daniel.goertzen@gmail.com</a>></p>
<div>
<p class=MsoNormal style='margin-bottom:12.0pt'>How about 1 process for each
cell, but no processes for the ants. The ants exist as state inside each
cell and as messages interrogating neighboring cells. I think you'll get
nice fine-grained localized transactions this way.<br>
<br>
Dan.</p>
</div>
</div>
<p class=MsoNormal style='margin-bottom:12.0pt'><br>
Using that method, I think you'll still have the same issue with transactions.
For instance: if two cells decide to move their ant to the same adjacent cell,
you will have the same conflict and one ant will have to be rolled back. <br>
It may not even be more efficient message-wise because instead of the ant
sending a message to an adjacent cell, the cell simply sends the same message
to the adjacent cell on behalf of the ant. <br>
<br>
Of course we could go existentialist and say that there is no board except what
the ants perceive, and since they can only see one square in any direction,
that would imply that there is 1 process for each ant and no process for a
board (or any data for that matter). This would mean that if there are no
ants on a section of board it would cease to exist. The only way to
reconstitute it would be to mathematically prove that it exists. e.g. The ant
was at 5,5 and moved 3 east, 8 < 64, therefore, the board
exists. <br>
<br>
One could extend this method with a Paxos algorithm so that the ants could
achieve consensus as to the existence of Board. <br>
<br>
</p>
</div>
</div>
</div>
</body>
</html>