<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<!--last modified on Saturday, October 03, 1998 04:19 PM -->
<HTML><!-- #BeginTemplate "/Templates/caplet.dwt" -->

<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html;CHARSET=iso-8859-1">
<!-- #BeginEditable "doctitle" --> 
<TITLE>Manna Mouse</TITLE>
<!-- #EndEditable --> 
<meta name="Author" content="Mark S. Miller">
<link rel=author rev=made href="mailto:markm@caplet.com" title="Mark S. Miller">
<META NAME="description" CONTENT="Caplet(tm) Security: A Consulting Company">
<META NAME="keywords" CONTENT="Capability Security, Capabilities, Cryptography, Distributed Objects, Distributed
  Language, Distributed Capabilities, Lambda Calculus, Scripting Language, Distributed Language, Persistent
  Language, Persistent Capabilities, Persistent Objects, Java Shell, Capability Shell, Scripting Java, Smart
  Contracting, Agoric E-Commerce, Open Source ">
</HEAD>

<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#0000FF" VLINK="#800080" background="images/back.jpg">
<P> 
<TABLE BORDER="0" width="100%">
  <TR VALIGN="TOP"> 
    <TD WIDTH="10%">&nbsp;</TD>
    <TD> 
      <P> 
      <TABLE BORDER="0" WIDTH="100%">
        <TR> 
          <TD ALIGN="LEFT"><a href="index.html"><img src="images/lgmarb3.gif" width="26" height="26" align="absmiddle" border="0"></a></TD>
          <TD ALIGN="RIGHT"> 
            <!-- #BeginEditable "BigTitle" --> 
            <P><font size="7" color="#000033">Manna Mouse:</font><font size=6 color="#000033"><br>
              <font size="5">Exploratory Fitness Landscaping</font></font> 
            <!-- #EndEditable -->
          </TD>
        </TR>
      </TABLE>
      <hr>
      <!-- #BeginEditable "LongBody" --> 
      <center>
        <p align="right"><font size=6 color="#000033"> </font> <font size=1> A 
          joint project of <a href="http://www.cocoon.com/"><img src="images/cocoon-fx.gif" border=0 align=absmiddle width=90 height=35></a> 
          and <a href="index.html">Caplet&#153;Security</a> </font> 
      </center>
      <p> 
      <center>
        <table border=0 cellspacing=0 cellpadding=0 width="500">
          <tr> 
            <td align=left valign=center><font size="2">Among interactive artificial 
              life simulations, Manna Mouse is uniquely simple: a creature's genome 
              encodes its location on the display area. This simplicity allows 
              us to <i>see</i> interesting dynamics that are often inaccessible.</font></td>
          </tr>
          <tr> 
            <td align=left valign=center><font size="2"><br>
              With your mouse you paint <font color="#00FF00"><b>manna</b></font>--the 
              reward function. By visualizing the fitness landscape, you can quickly 
              build intuitions about evolution.</font></td>
          </tr>
        </table>
      </center>
      <p> 
      <center>
        <table border=0 cellspacing=0 cellpadding=0 cols=2 width="300">
          <tr> 
            <td align=center valign=center rowspan=3><font size="1"><b><i>To start, 
              press go.</i></b></font></td>
            <td align=center valign=center><font size="1"><a href="#playing">how 
              to play</a></font></td>
          </tr>
          <tr> 
            <td align=center valign=center><font size="1"><a href="#parameters">changing 
              parameters</a></font></td>
          </tr>
          <tr> 
            <td align=center valign=center><font size="1"><a href="#sources">source 
              code</a></font></td>
          </tr>
        </table>
      </center>
      <p> 
        <center>
          <applet name="MannaMouse" archive="MannaMouse.jar" code="com/caplet/manna/Demographics.class" align="top" width=620 height=400>
            Please enable Java in your browser. 
          </applet> 
        </center>
      <p> <a name="playing"></a> 
      <p> 
      <h3>Manna Mouse Applet</h3>
      <p> You see the evolution of two, separate populations of creatures. A creature's 
        genotype encodes two values--an x coordinate and a y coordinate. The phenotype 
        is expressed as a dot on the display area.<br>
        <br>
        For each population, the first generation is determined randomly. Without 
        a fitness function to selectively steer reproduction, subsequent generations 
        of creatures appear to be moving randomly through the 2-d space.<br>
        <br>
        Genetic Algorithms were invented by John Holland. See my <a href="http://www.reason.com/9612/bk.miller.html">book 
        review</a> of John Holland's <i>Hidden Order</i>, appearing in the December 
        1996 issue of Reason Magazine.<br>
        <a name="manna"></a> 
      <p> 
      <h3><font size="2">Painting <font color="#00FF00"><b>Manna</b></font></font></h3>
      <p><font size="2"> Click <b>stop</b>.<br>
        <br>
        Mouse down in one of the population areas. Slowly, drag the mouse to paint 
        manna. Start with something simple, such as a vertical line. The manna 
        appears in both populations.<br>
        <br>
        Click <b>go</b>.<br>
        <br>
        The distribution of manna is the fitness function; creatures located on 
        manna are selected for, during reproduction. But manna is consumed, and 
        eventually, the population returns to random movement.<br>
        <br>
        For GA aficionados, we are using tournaments rather than roulette wheels, 
        and we do collision avoidance: if a mating would result in creating a 
        creature in an occupied location, we try again rather than redundantly 
        search.<br>
        <br>
        <a name="controls"></a> </font> 
      <p> 
      <h3><font size="2">Manna Mouse Controls</font></h3>
      <p> 
      <ul>
        <li><font size="2"><b>go</b>: Start or resume the simulation. You can 
          change parameters and draw manna while the simulation is running. To 
          stop it, click stop.<br>
          <br>
          </font> 
        <li><font size="2"><b>stop</b>: Stop the simulation. To resume it, click 
          go.<br>
          </font> 
      </ul>
      <a name="parameters"></a> 
      <p> 
      <h3><font size="2">Manna Mouse Parameters</font></h3>
      <p> <font color="#80001C" size="2"><b>Note:</b> If you do not see the ui 
        controls for changing the algorithm's parameters scroll the applet into 
        view in the browser window.</font><font size="2"><br>
        <br>
        Set the parameters the same in both populations and watch a few runs; 
        you will be surprised at the divergence. This is known as <i>sensitivity 
        to initial conditions</i>: where an evolutionary process ends up depends 
        not only on the rewards but where it starts.<br>
        <br>
        </font> 
      <ul>
        <li><font size="2"><b>population</b>: The population size can be changed. 
          When increased, the new creatures are placed in randomly-determined 
          locations.<br>
          <br>
          </font> 
        <li><font size="2"><b>mutants</b>: The mutation rate defines the percentage 
          of the evolving population that has a random bit flipped. These random 
          mutations can increase the genetic diversity over what is seen with 
          crossover alone.<br>
          <br>
          </font> 
        <li><font size="2"><b>gray</b>: A Gray representation encodes the genotype 
          in a way that results in adjacent positions differing only by one bit. 
          Binary representations do not have this property. If a transformation 
          happens to invoke the hardware's carry operation, adjacent positions 
          will have very dissimilar genotypes.<br>
          <br>
          <font color="#80001C"><b>Note:</b> Gray representation has not been 
          implemented yet -- the default is binary.</font><br>
          <br>
          </font> 
        <li><font size="2"><b>uniform</b>: When two creatures mate, how are their 
          genotypes combined to create their offspring? The two options are <i>uniform 
          crossover</i> and <i>two-point crossover</i> (seen in bacteria).<br>
          <br>
          In uniform crossover the contribution from each parent is determined 
          randomly.<br>
          <br>
          In two-point crossover, the two ends of the genotype are joined to form 
          a ring, removing the significance of the end points. The ring is cut 
          at two positions, determined randomly. The parents contribute alternate 
          segments to their offspring. For example, if the rings are cut at positions 
          <i>A and B</i>, the child's genotype is made up of the segment from 
          <i>A to B</i> of one parent and the segment from <i>B to A</i> of the 
          other parent.<br>
          <br>
          </font> 
        <li><font size="2"><b>local</b>: Are creatures more likely to mate if 
          they are closer together?<br>
          <br>
          <font color="#80001C"><b>Note:</b> Spatial locality has not been implemented 
          yet.</font><br>
          <br>
          </font> 
        <li><font size="2"><b>consumed</b>: Is manna consumed when it is eaten? 
          The pure notion of a fitness landscape (or function optimization) would 
          not allow for manna consumption, but it makes for more interesting dynamics. 
          As the manna is consumed, its color changes from green to red before 
          finally disappearing.<br>
          </font> 
      </ul>
      <p><a name="sources"></a> </p>
          <table width="100%" cellpadding="6">
            <tr> 
              <td>
                <p> 
                <h3><font size="2"><a href="javadoc/index.html">Javadoc</a>-umentation, 
                  and source code (AWT 1.0):</font></h3>
                <p> 
                <ul>
                  <li><font size="2"><a href="src/com/caplet/manna/Demographics.java">user 
                    interface</a> </font> 
                  <li><font size="2"><a href="src/com/caplet/manna/Culture.java">petri 
                    dish</a> </font> 
                  <li><font size="2"><a href="src/com/caplet/manna/GAPainter.java">evolver 
                    thread</a> </font> 
                  <li><font size="2"><a href="src/com/caplet/manna/GA.java">genetic 
                    algorithm</a></font>
                </ul>
              </td>
              <td>
            <script language=javascript src="http://ss.webring.yahoo.com/navbar?f=j&y=capsecure&u=98142757410242990"></script>
          </td>
            </tr>
          </table>
      <!-- #EndEditable --></TD>
    <TD WIDTH="10%">&nbsp;</TD>
  </TR>
  <TR VALIGN="TOP"> 
    <TD WIDTH="10%">&nbsp;</TD>
    <TD> 
      <hr>
      <div align="center"> 
        <p><a href="index.html"><img src="images/lgmarb3.gif" width="26" height="26" align="bottom" border="0"></a> 
          <i><b><font size="5">H</font>ome</b></i></p>
        <table width="100%" border="0" cellspacing="0" cellpadding="4">
          <tr> 
            <td> 
              <div align="left"><i><a href="mailto:webmaster@caplet.com">email 
                MarkM</a></i><br>
                or <a href="http://www.blindpay.com/crit-me-now.cgi"><img src="images/cmn.gif" width="98" height="21" border="0"></a> 
              </div>
            </td>
            <td> 
              <div align="right"><a href="http://www.epic.org/crypto/"><img src="images/key.gif" width="37" height="19" alt="Golden Key Campaign" border="0"></a>&nbsp;<a href="http://www.eff.org/br/"><img src="images/ribbon.gif" width="18" height="30"
alt="Blue Ribbon Campaign" border="0"></a><br>
                <a href="http://www.freesklyarov.org/"><i>Free Dimitry!</i></a> 
              </div>
            </td>
          </tr>
        </table>
      </div>
    </TD>
    <td width="10%" valign="bottom">&nbsp;</td>
  </TR>
</TABLE>
</BODY>

<!-- #EndTemplate --></HTML>
