home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 3 / TheARMClub_PDCD3.iso / hensa / misc / a154_1 / !Tierra / doc / tierra_doc < prev   
Text File  |  1992-07-06  |  166KB  |  3,562 lines

  1. /* TIERRA.DOC  2-7-92  documentation for the Tierra Simulator */
  2. /* Tierra Simulator V3.13: Copyright (c) 1991, 1992 Tom Ray & Virtual Life */
  3.  
  4. This file contains the following sections:
  5.  
  6. 1)  LICENSE AGREEMENT
  7. 2)  WHAT THIS PROGRAM IS, PUBLICATIONS, NEWS
  8. 3)  RELATED SOFTWARE (IMPORTANT)
  9. 4)  QUICK START   <-------------- You might want to start here! 
  10.   4.1) DOS QUICK START
  11.   4.2) UNIX QUICK START
  12. 5)  RUNNING TIERRA
  13.   5.1) Startup
  14.   5.2) The Assembler/Disassembler
  15.   5.3) The Birth-Death Output
  16.   5.4) The Genebank Output
  17.   5.5) Restarting an Old Run
  18.   5.6) The User Interface
  19.     5.6.1) The Basic Interface
  20.       5.6.1.1) The Basic Screen
  21.       5.6.1.2) The Menu Options
  22.         5.6.1.2.1) The Size Histogram
  23.         5.6.1.2.2) The Memory Histogram
  24.         5.6.1.2.3) The Genotype Histogram
  25.         5.6.1.2.4) The Size Class Information Display
  26.         5.6.1.2.5) The Virtual Debugger
  27.         5.6.1.2.6) The Genome Injector
  28.     5.6.2) The Standard Output
  29.     5.6.3) The tierra.log file
  30. 6)  LISTING OF DISTRIBUTION FILES
  31. 7)  SOUP_IN PARAMETERS (IMPORTANT)
  32. 8)  THE INSTRUCTION SET(S)
  33. 9)  THE ANCESTOR & WRITING A CREATURE
  34.   9.1) The Ancestor
  35.   9.2) Writing a Creature
  36. 10)  IF YOU WANT TO MODIFY THE SOURCE CODE
  37.   10.1) Creating a Frontend
  38.   10.2) Creating New Instruction Sets
  39.   10.3) Creating New Slicer Mechanisms
  40.   10.4) Creating a Sexual Model
  41.   10.5) Creating a Multi-cellular Model
  42. 11) KNOWN BUGS
  43. 12) IF YOU HAVE PROBLEMS
  44.   12.1) Problems with Installation
  45.   12.2) Problems Running Tierra
  46. 13) REGISTRATION & MAILING LISTS
  47.  
  48. 1)  LICENSE AGREEMENT
  49.  
  50. /* 
  51.  * Tierra Simulator V3.13: Copyright (c) 1990, 1991, 1992 Thomas S. Ray
  52.  * 
  53.  * by Tom Ray, ray@brahms.udel.edu ray@santafe.edu (the bulk of the code)
  54.  *    Dan Pirone, cocteau@life.slhs.udel.edu (frontend, overhaul, sex)
  55.  *    Tom Uffner, tom@genie.slhs.udel.edu (rework of genebanker & assembler)
  56.  * 
  57.  * If you purchased this program on disk, thank you for your support.  If 
  58.  * you obtained the source code through the net or friends, we invite you to
  59.  * contribute an amount that represents the program's worth to you.  You may
  60.  * make a check in US dollars payable to Virtual Life, and mail the check to
  61.  * one of the two addresses listed below.
  62.  * 
  63.  * This license agreement has two parts: 
  64.  * 
  65.  * 1) The source code, documentation, and the beagle.exe file can be freely
  66.  *    distributed.
  67.  * 
  68.  * 2) The executables (the .exe files in DOS) are for sale and can not be
  69.  *    freely distributed (with the exception of the beagle.exe file).
  70.  *    Executables (binaries) on any platform (Unix, Mac, Amiga, DOS, etc.)
  71.  *    can not be freely distributed.
  72.  * 
  73.  * These two points are elaborated below:
  74.  * 
  75.  * 1) The source code, documentation, and the beagle.exe file can be freely
  76.  *    distributed.
  77.  * 
  78.  * The source code and documentation is copyrighted, all rights reserved.
  79.  * The source code, documentation, and the beagle.exe file may be freely
  80.  * copied and distributed without fees (contributions welcome), subject to
  81.  * the following restrictions:
  82.  * 
  83.  * - This notice may not be removed or altered.
  84.  * 
  85.  * - You may not try to make money by distributing the package or by using the
  86.  *   process that the code creates.
  87.  * 
  88.  * - You may not prevent others from copying it freely.
  89.  * 
  90.  * - You may not distribute modified versions without clearly documenting your
  91.  *   changes and notifying the principal author.
  92.  * 
  93.  * - The origin of this software must not be misrepresented, either by
  94.  *   explicit claim or by omission.  Since few users ever read sources,
  95.  *   credits must appear in the documentation.
  96.  * 
  97.  * - Altered versions must be plainly marked as such, and must not be
  98.  *   misrepresented as being the original software.  Since few users ever read
  99.  *   sources, credits must appear in the documentation.
  100.  * 
  101.  * 2) The executables (the .exe files in DOS) are for sale and can not be
  102.  *    freely distributed (with the exception of the beagle.exe file).
  103.  *    Executables (binaries) on any platform (Unix, Mac, Amiga, DOS, etc.)
  104.  *    can not be freely distributed.
  105.  * 
  106.  * The executables (the .exe files in DOS) are copyrighted, all rights
  107.  * reserved.  You should treat this software just like a book.  This means
  108.  * that this software (the executables) may be used by any number of people
  109.  * and may be freely moved from one computer to another so long as the program
  110.  * is not used by more than one person at a time.  This applies to binaries on
  111.  * any platform.
  112.  * 
  113.  *   The following provisions also apply in both cases 1 and 2: 
  114.  * 
  115.  * - Virtual Life and the authors are not responsible for the consequences of
  116.  *   use of this software, no matter how awful, even if they arise from flaws
  117.  *   in it.
  118.  * 
  119.  * - Neither the name of Virtual Life, nor the authors of the code may be used
  120.  *   to endorse or promote products derived from this software without
  121.  *   specific prior written permission.
  122.  * 
  123.  * - The provision of support and software updates is at our discretion.
  124.  * 
  125.  * Please contact Tom Ray (full address below) if you have questions or would
  126.  * like an exception to any of the above restrictions.
  127.  * 
  128.  * If you make changes to the code, or have suggestions for changes,
  129.  * let us know!  If we use your suggestion, you will receive full credit
  130.  * of course.
  131.  * 
  132.  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
  133.  * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
  134.  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  135.  *
  136.  *    Tom Ray
  137.  *
  138.  *    Virtual Life              (September through December)
  139.  *    P.O. Box 625
  140.  *    Newark, Delaware  19715
  141.  *
  142.  *    School of Life & Health Sciences
  143.  *    University of Delaware
  144.  *    Newark, DE  19716
  145.  *
  146.  *    ray@udel.edu (email)
  147.  *    302-831-2753 (Phone)
  148.  *    302-831-2281 (Fax)
  149.  *
  150.  *    or
  151.  *
  152.  *    Santa Fe Institute        (January through August)
  153.  *    1660 Old Pecos Trail
  154.  *    Suite A
  155.  *    Santa Fe, NM 87501
  156.  *
  157.  *    ray@santafe.edu (email)
  158.  *    505-984-8800 (Phone)
  159.  *    505-982-0565 (Fax)
  160.  */
  161.  
  162. 2)  WHAT THIS PROGRAM IS, PUBLICATIONS, NEWS
  163.  
  164.      The C source code creates a virtual computer and its operating system,
  165. whose architecture has been designed in such a way that the executable
  166. machine codes are evolvable.  This means that the machine code can be mutated
  167. (by flipping bits at random) or recombined (by swapping segments of code
  168. between algorithms), and the resulting code remains functional enough of the
  169. time for natural (or presumably artificial) selection to be able to improve
  170. the code over time.
  171.  
  172.      Along with the C source code which generates the virtual computer, we
  173. provide several programs written in the assembler code of the virtual
  174. computer.  One of these was written by a human and does nothing more than make
  175. copies of itself in the RAM of the virtual computer.  The others evolved from
  176. the first, and are included to illustrate the power of natural selection.
  177.  
  178.      The virtual machine is an emulation of a MIMD (multiple instruction
  179. stream, multiple data stream) computer.  This is a massively parallel computer
  180. in which each processor is capable of executing a sequence of operations
  181. distinct from the other processors.  The parallelism is only emulated by
  182. time slicing, but there really are numerous virtual CPUs.  One CPU will be
  183. created and assigned to each ``creature'' (self-replicating algorithm)
  184. living in the RAM of the virtual computer.  The RAM of the virtual computer
  185. is known as the ``soup''.
  186.  
  187.      The operating system of the virtual computer provides memory management
  188. and timesharing services.  It also provides control for a variety of factors
  189. that affect the course of evolution: three kinds of mutation rates,
  190. disturbances, the allocation of CPU time to each creature, the size of the
  191. soup, etc.  In addition, the operating system provides a very elaborate
  192. observational system that keeps a record of births and deaths, sequences
  193. the code of every creature, and maintains a genebank of successful genomes.
  194. The operating system also provides facilities for automating the ecological
  195. analysis, that is, for recording the kinds of interactions taking place
  196. between creatures.
  197.  
  198.      The version of the software currently being distributed is considered
  199. to be a research grade implementation.  This means two things: 1) It is
  200. under very rapid development, and may not be completely bug free.  2) We have
  201. chosen to go with modifiability and modularity over speed of execution.
  202.  
  203.      If you find bugs in the code, please report them to us.  By the time
  204. you find them and report them, we may have eliminated them, and would be
  205. able to provide you with a fixed version.  If not, we will be able to fix
  206. the bug, and would like to make the fix available to other users.
  207.  
  208.      We have chosen modifiability over speed primarily because we know that
  209. the current version of the virtual computer is very poorly designed, except
  210. with respect to the features that make it evolvable.  Specifically, consider
  211. that one third of the present instruction set is taken up by pushing and
  212. popping from the stack; there are only two inter-register moves, ax to bx and
  213. cx to dx; dx isn't used for anything (in the original version, dx was used to
  214. set the template size, but that has been abandoned); there are no moves
  215. between CPU registers and RAM; there is no I/O; and there is no way of
  216. addressing a data segment.
  217.  
  218.      In August 1991, 100% of the original virtual CPU code was replaced, with
  219. new code that does exactly the same thing.  However, the new code is written
  220. in a generalized way, a meta-virtual computer, that will make it trivial to
  221. alter the machine architecture.  With the new implementation of the virtual
  222. computer, it will be possible for anyone to painlessly swap in their favorite
  223. CPU architecture and instruction set, and their innovation will be seamlessly
  224. embedded within the heart of the elaborate observational software.  Knowing
  225. how bad the original design was, there was a temptation to fix it when the
  226. virtual computer was reworked, but the original implementation was retained
  227. for historical reasons.  In spite of its shortcomings, life proliferated in
  228. the environment that it created.  Things should get interesting as we improve
  229. the architecture.  The new organization of the code should make that easy.
  230.  
  231.      The bulk of the code and documentation was written by Tom Ray, whose
  232. address is listed at the end of this file.  Substantial contributions have
  233. been made by: Dan Pirone, cocteau@santafe.edu, has been involved in
  234. the Tierra project since the Fall of 1990.  Dan began working full
  235. time on Tierra in February 1992.  Dan has written the user interface,
  236. and has been making a general overhaul of the code, getting the bugs out
  237. and introducing some new features.  Tom Uffner, tom@genie.slhs.udel.edu,
  238. reworked the genebanker and assembler/disassembler in the Fall of 1991.
  239. Marc Cygnus, cygnus@udel.edu, developed the ALmond monitor, a separate piece
  240. of software that displays activity in a running Tierra (see below).
  241.  
  242.      The behavior of this software is described in the following publications:
  243.  
  244. Ray, T. S.  1991.  ``Is it alive, or is it GA?''
  245. Proceedings of the 1991 International Conference on Genetic Algorithms,
  246. Eds. Belew, R. K., and L. B. Booker, San Mateo, CA: Morgan Kaufmann, 527-534.
  247.  
  248. Ray, T. S.  1991.  ``An approach to the synthesis of life.''
  249. Artificial Life II, Santa Fe Institute Studies in the Sciences of
  250. Complexity, vol. XI, Eds. Farmer, J. D., C. Langton, S. Rasmussen, &
  251. C. Taylor, Redwood City, CA: Addison-Wesley, 371-408.
  252.  
  253. Ray, T. S.  1991.  ``Population dynamics of digital organisms.''
  254. Artificial Life II Video Proceedings,  Ed. C.G. Langton,
  255. Redwood City, CA: Addison Wesley.
  256.  
  257. Ray, T. S.  1991.  ``Evolution and optimization of digital organisms.''
  258. Scientific Excellence in Supercomputing: The IBM 1990 Contest Prize
  259. Papers, Eds. Keith R. Billingsley, Ed Derohanes, Hilton Brown, III.
  260. Athens, GA, 30602, The Baldwin Press, The University of Georgia.
  261. Publication date: December 1991.
  262.  
  263.      This research has been widely reported in the media:
  264.  
  265. Nature (John Maynard Smith, UK) February 27, 1992: ``Byte-sized evolution.
  266. ...we badly need a comparative biology.  So far, we have been able to study
  267. only one evolving system and we cannot wait for interstellar flight to
  268. provide us with a second.  If we want to discover generalizations about
  269. evolving systems, we will have to look at artificial ones.  Ray's study is a
  270. good start.''
  271.  
  272. New York Times (Malcolm Browne, USA) August 27, 1991: ``Lively Computer
  273. Creation Blurs Definition of Life.  Software forms, obeying Darwin's rules,
  274. vie to avoid the `reaper'.''
  275.  
  276. Science News (John Travis, USA) August 10, 1991: ``Digital Darwinism:
  277. Electronic Ecosystem.  Evolving `life' flourishes and surprises in a
  278. novel electronic world''.
  279.  
  280. Scientific American (John Rennie, USA) January 1992: ``Cybernetic Parasites...
  281. Tierra... has been hailed as the most sophisticated artificial-life program
  282. yet developed...''
  283.  
  284. New Scientist (Roger Lewin, UK) February 22, 1992: ``Life and death in a
  285. digital world.  No one can turn back the evolutionary clock, but we can
  286. follow the fate of a rich menagerie of artificial organisms as they evolve
  287. in a model world.''
  288.  
  289. The Economist (Anon, UK) January 4, 1992: ``The meaning of `life'.
  290. In order to understand the origin of life, scientists are switching from the
  291. chemistry set to the computer.  In the process, they are beginning to
  292. understand what it means to be alive.''
  293.  
  294. Actuel (Ariel Kyrou, France) April 1992: ``Visite Guidee Aux Extremes De
  295. La Science: La Vie Artificielle.  Etes-vous pr\^{e}ts \`{a} entrer dans
  296. l'univers vertigineux de la vie artificielle?  Un champ scientifique tout neuf
  297. sur lequel se penchent les grosses t\^{e}tes et les Nobel de labos
  298. am\'{e}ricains.''
  299.  
  300. The Chronicle of Higher Education (David Wilson, USA) December 4, 1991:
  301. ``Approaching Artificial Life on a Computer.  Survival-of-the-fittest
  302. electronic organisms dramatically illustrate Darwinian principles.''
  303.  
  304. Mikrobitti (Pekka Tolonen, Finland) November 1991: ``Olemmeko humanoiden
  305. biologinen koe?  Tierra simuloi el\"{a}m\"{a}\"{a}.''
  306.  
  307. Europeo (Giovanni Caprara, Italy) September 1991: ``Anche il computer ha
  308. fatto un figlio.  Un biologo americano ha creato un software capace di
  309. elaborare programmi che si evolvono da soli.''
  310.  
  311. GenteMoney (Riccardo Orizio, Italy) November 1991: ``Cos\`{\i} ho dato
  312. la vita al software.''
  313.  
  314. Computerworld (Michael Alexander, USA) September 30, 1991: ``Tierra adds to
  315. evolutionary studies.  A computerized world created on an IBM PC could
  316. have real-world benefits for scientists.''
  317.  
  318. Sueddeutsche Zeitung (Konrad Peters, Germany) October 21, 1991:
  319. ``Die Evolution im Computer.  `K\"{u}nstliches Leben' hilft Biologen und
  320. Informatikern auf die Spr\"{u}nge.''
  321.  
  322. Super Interessante (Anon, Brazil) November 1991: ``A vida dentro do
  323. computador.''
  324.  
  325. Technology Review (Susan Scheck, USA) April 14, 1991: ``Is It Live Or Is
  326. It Memory?''
  327.  
  328. Corriere Della Sera (Giovanni Capara, Italy) August 28, 1991: ``Pronto in
  329. USA il programma che si riproduce.  Il computer `padre' crea vita
  330. informatica.''
  331.  
  332. Fakta (Tom Ottmar, Norway) March 1992: ``Den Lever!  En `skabning', der
  333. best\aa r af nuller og \'{e}nere, er vokset ud af indamaden p\aa \ en
  334. computer og er blevet en videnskabelig sensation i USA.''
  335.  
  336. Associated Press (Theresa Humphrey, USA) October 1991: ``Bringing life to
  337. computer.  U of D biologist's program is self-replicating, shows evolution.''
  338.  
  339. Hovedomr\aa det (Jakob Skipper, Denmark) December 6, 1990: ``Kunstigt liv.
  340. Nu kommer det kunstige liv.  En voksende gruppe af dataloger, biologer,
  341. fysikere, psykologer og mange andre forskere efterlinger p\aa \ computer
  342. det naturlige liv.''
  343.  
  344. 3)  RELATED SOFTWARE (IMPORTANT)
  345.  
  346.      The Tierra simulator is the central piece of a growing set of programs.
  347. The accessory programs aid in observing the results of Tierra runs.  You will
  348. want to select one or both of the following:
  349.  
  350.   3.1) The Beagle Explorer which graphically displays the output that Tierra
  351.    saves to disk.  Beagle runs only on DOS systems, and while the heart of
  352.    the source code is available, Beagle uses the Greenleaf DataWindows
  353.    interface, and that source can not be distributed (available from
  354.    Greenleaf Software, 16479 Dallas Parkway, Bent Tree Tower Two, Suite 570,
  355.    Dallas, Texas, 75248, phone: 214-248-2561).  Beagle would normally be
  356.    distributed in the executable form.  Once you have the executables, you
  357.    will be able to run them on your PC, and you will not need Greenleaf.
  358.    You only need Greenleaf if you plan to modify the source code.  Beagle is
  359.    currently configured only for the CGA or VGA graphics modes, but can be
  360.    extended on request, in time.  Beagle executables are now available on disk
  361.    from Virtual Life, or in the same ftp site as the Tierra source code, in
  362.    the directory: /tierra/beagle.  If you pick up the Beagle executables from
  363.    the ftp site, remember to trasfer the files in binary mode.
  364.  
  365.   3.2) The ALmond Monitor which displays activity in a running Tierra
  366.    simulator.  ALmond runs as a simultaneous but independent process (from
  367.    Tierra) on the same or on a seperate machine, and establishes network
  368.    socket communication with Tierra.  ALmond can be attached to and detached
  369.    from a running Tierra simulator without interrupting the simulation.
  370.    ALmond runs only on unix systems supporting X Windows.  The entire ALmond
  371.    source code is available.  Almond was developed and tested on Sun 3 and Sun
  372.    4 machines.  It was developed under X11R4 by Marc Cygnus.  Dan Pirone
  373.    has now taken over ALmond development. 
  374.  
  375. 4)  QUICK START 
  376.  
  377.      The steps required to run the system on DOS and UNIX are slightly
  378. different, so there are two sets of instructions listed below.
  379.  
  380.   4.1) DOS QUICK START
  381.  
  382.      If you obtained the Tierra software on disk, the installation program
  383. will take care of steps 1 - 3, so you can skip to step 4.  If you
  384. obtained the software over the net, start with step 1. 
  385.  
  386.       step 1)  You should have a directory containing the executables and
  387. source code and two subdirectories: td and gb.  The td directory is where a
  388. record of births and deaths will be written.  The gb directory contains the
  389. initial genomes used to innoculate the soup and the opcode map, and the
  390. genebanker will save new genomes to this directory.
  391.  
  392.       step 2)  You must compile the assember/disassembler, arg, and the
  393. simulator, tierra.  We include the two Turbo C V 2.0 project files:
  394. tierrav2.prj and argv2.prj and the Borland C++ project files: tierrapp.prj
  395. and argpp.prj.  Rename the relevant versions to: arg.prj and tierra.prj.
  396.  
  397. for Borland C++:
  398.  
  399. ren argpp.prj arg.prj
  400. ren tierrapp.prj tierra.prj
  401.  
  402. or for Turbo C V 2.0:
  403.  
  404. ren argv2.prj arg.prj
  405. ren tierrav2.prj tierra.prj
  406.  
  407.      Compile these projects using the large memory 
  408. model.  Put the executables in the path.
  409.  
  410.       step 3)  You must assemble the initial genomes, as binaries are not
  411. portable.  To do this, go into the gb directory and type:
  412.  
  413. arg c 0080.gen 80 0080aaa.tie
  414. arg c 0045.gen 45 0045aaa.tie
  415.  
  416. This will create the two binary files 0080.gen and 0045.gen which contain two
  417. creatures that you can use to innoculate the soup, the ancestor 0080aaa
  418. and a parasite that evolved from the ancestor, 0045aaa.  You can check to
  419. see if this worked by disassembling the two genomes, by typing:
  420.  
  421. arg x 0080.gen aaa
  422. arg x 0045.gen aaa
  423.  
  424. This will create the two ascii files 0080aaa and 0045aaa.  Compare them to
  425. the originals, 0080aaa.tie and 0045aaa.tie (they will not be exactly the
  426. same).  Before you start a run, copy 0080.gen to 0080gen.vir and copy
  427. 0045.gen to 0045gen.vir, in order to have virgin copies for use later when
  428. you start another run.
  429.  
  430. copy 0045.gen 0045gen.vir
  431. copy 0080.gen 0080gen.vir
  432.  
  433.       step 4)  Go back to the source code directory and examine the file
  434. soup_in.  This file contains all of the parameters that control the run.  It
  435. is currently set up to innoculate the soup with one cell of genotype 0080aaa,
  436. and to run for 500 million instructions in a soup of 50,000 instructions.  You
  437. will need a text editor if you want to modify this file.  If you use a regular
  438. word processor, be sure that you write the file back out as a plain ASCII text
  439. file.
  440.  
  441.       step 5)  Run the simulator by typing: tierra
  442.  
  443.       step 6)  When the run is over, if you want to start a new run, you
  444. should clean up the genebank, because the simulator will read in all genomes
  445. in the genebank at startup.  The best way to do this is to go into the gb
  446. directory and remove all .gen, and .tmp files, and then copy the backup
  447. version of the 0080.gen file:
  448.  
  449. cd gb
  450. del *.gen
  451. del *.tmp
  452. copy 0080gen.vir 0080.gen
  453.  
  454.      A DOS batch file has been provided to perform this cleanup automatically.
  455. It is named clearrun.bat, and has the following contents:
  456.  
  457. del td\break.*
  458. del gb\*.gen
  459. del gb\*.tmp
  460. copy gb\0080gen.vir gb\0080.gen
  461. del core_out
  462. del soup_out
  463. del tierra.log
  464.  
  465.      All you have to do is type ``clearrun'' to the DOS prompt, and the
  466. batch file will take care of the cleanup.
  467.  
  468.      If you wish to use a cumulative genebank in successive runs, use the
  469. cumclear.bat file rather than the clearrun.bat file:
  470.  
  471. del td\break.*
  472. del gb\*.tmp
  473. del core_out
  474. del soup_out
  475. del tierra.log
  476.  
  477.   4.2) UNIX QUICK START
  478.  
  479.       step 1)  You should have a directory containing the source code and two
  480. subdirectories: td and gb.  The td {tiedat} directory is where a record of
  481. births and deaths will be written.  The gb {genebank} directory contains the
  482. initial genomes used to innoculate the soup and the opcode map, and the
  483. genebanker will save new genomes to this directory.
  484.  
  485.       step 2)  You must compile the assember/disassembler, arg, and the
  486. simulator, tierra.  Two executable files, ccarg and cctierra are included
  487. which perform the compilation.  You may have to alter the flags for your
  488. system.  You must change the protection on these files to make them
  489. executable: chmod +x ccarg, chmod +x cctierra.  Then just type ccarg, then
  490. type cctierra to get the programs compiled.
  491.  
  492.      There is also a Makefile included which is preferable, if it works on
  493. your system.  This Makefile needs to be edited to comment in the lines for
  494. your particular hardware.  It has been tested on Sun 3, Sun 4, IBM RS6000,
  495. Silicon Graphics Personal Iris and Indigo, DEC DS5000, and NeXT.
  496. If you can use the Makefile, type: make, and follow instructions.
  497.  
  498.       step 3)  You must assemble the initial genomes, as binaries are not
  499. portable.  To do this, go into the gb directory and type:
  500.  
  501. ../arg c 0080.gen 80 0080aaa.tie
  502. ../arg c 0045.gen 45 0045aaa.tie
  503.  
  504. This will create the two binary files 0080.gen and 0045.gen which contain
  505. two creatures that you can use to innoculate the soup, the ancestor 0080aaa
  506. and a parasite that evolved from the ancestor, 0045aaa.  You can check to
  507. see if this worked by disassembling the two genomes, by typing:
  508.  
  509. ../arg x 0080.gen aaa
  510. ../arg x 0045.gen aaa
  511.  
  512. This will create the two ascii files 0080aaa and 0045aaa.  Compare them to
  513. the originals, 0080aaa.tie and 0045aaa.tie {they will not be exactly the
  514. same}.  Before you start a run, copy 0080.gen to 0080gen.vir and copy
  515. 0045.gen to 0045gen.vir, in order to have virgin copies for use later when
  516. you start another run.
  517.  
  518. cp 0045.gen 0045gen.vir
  519. cp 0080.gen 0080gen.vir
  520.  
  521.       step 4)  Go back to the source code directory and examine the file
  522. soup_in.  This file contains all of the parameters that control the run.  It
  523. is currently set up to innoculate the soup with one cell of genotype 0080aaa,
  524. and to run for 500 million instructions in a soup of 50,000 instructions.
  525.  
  526.       step 5)  Run the simulator by typing:
  527.            tierra
  528.        or: tierra > /dev/null &  {to run it in the background
  529.                      a Log file can be created by setting
  530.                      the soup_in variable Log = 1}
  531.  
  532.      In order to run tierra in the background, you must compile it with:
  533.  
  534. #define FRONTEND STDIO
  535.  
  536.      If you will run Tierra in the foreground, we recommend that you use:
  537.  
  538. #define FRONTEND BASIC
  539.  
  540.      These definitions are made in the configur.h file.
  541.  
  542.       step 6)  When the run is over, if you want to start a new run, you
  543. should clean up the genebank.  The best way to do this is to go into the gb
  544. directory and remove all .gen, and .tmp files, and then copy the backup
  545. version of the 0080.gen file:
  546.  
  547. cd gb
  548. rm *.gen
  549. rm *.tmp
  550. cp 0080gen.vir 0080.gen
  551.  
  552.      A Unix shell script has been provided to perform this cleanup
  553. automatically.  It is named clearrun, and has the following contents:
  554.  
  555. rm td/break.*
  556. rm gb/*.gen
  557. rm gb/*.tmp
  558. cp gb/0080gen.vir gb/0080.gen
  559. rm core_out
  560. rm soup_out
  561. rm tierra.log
  562.  
  563.      You must make the clearrun file executable by changing its protection:
  564.  
  565. chmod +x clearrun
  566.  
  567.      Then all you have to do is type ``clearrun'' to the prompt, and the
  568. shell script will take care of the cleanup.
  569.  
  570.      If you wish to use a cumulative genebank in successive runs, use the
  571. cumclear file rather than the clearrun file:
  572.  
  573. rm td/break.*
  574. rm gb/*.tmp
  575. rm core_out
  576. rm soup_out
  577. rm tierra.log
  578.  
  579. 5)  RUNNING TIERRA
  580.  
  581.      This section has the following sub-sections:
  582.  
  583.   5.1) Startup
  584.   5.2) The Assembler/Disassembler
  585.   5.3) The Birth-Death Output
  586.   5.4) The Genebank Output
  587.   5.5) Restarting an Old Run
  588.   5.6) The User Interface
  589.     5.6.1) The Basic Interface
  590.       5.6.1.1) The Basic Screen
  591.       5.6.1.2) The Menu Options
  592.         5.6.1.2.1) The Size Histogram
  593.         5.6.1.2.2) The Memory Histogram
  594.         5.6.1.2.3) The Genotype Histogram
  595.         5.6.1.2.4) The Size Class Information Display
  596.         5.6.1.2.5) The Virtual Debugger
  597.         5.6.1.2.6) The Genome Injector
  598.     5.6.2) The Standard Output
  599.     5.6.3) The tierra.log file
  600.  
  601.   5.1) Startup
  602.  
  603.      The first steps in running Tierra are described briefly above.  One must
  604. place the genomes and the opcode map in the gb directory, and one must have
  605. created the td directory to receive the output of birth and death data.  The
  606. genome files are supplied in the form of ASCII assembler code files.  These
  607. must be assembled into binary form to be able to execute on the virtual
  608. machine.  If you type arg, the assembler will give you a brief listing of
  609. assembler options.  More complete documentation of the assembler follows:
  610.  
  611.   5.2) The Assembler/Disassembler
  612.  
  613.      This documentation was written by Tom Uffner.  A troff version is
  614. included in arg.1
  615.  
  616. Arg(1)                   USER COMMANDS                     Arg(1)
  617.  
  618. NAME
  619.      arg - genbank archive utility
  620.  
  621. SYNOPSIS
  622.      arg c|r[vo12...9] afile size file1 [file2...]
  623.      arg x|t[vo12...9] afile [gen1 [gen2...]]
  624.  
  625. DESCRIPTION
  626.      The arg utility is used to manipulate the genebank  archives
  627.      that  are used by tierra(1).  It is used to assemble or dis-
  628.      sasemble tierra code, list the genomes contained in a  file,
  629.      and also to convert between the old and new file formats.
  630.  
  631.      The arg commands are:
  632.  
  633.           c - create afile and add genomes in file1...filen
  634.  
  635.           r - replace  in  afile  (or  add  to  end)  genomes  in
  636.                file1...filen
  637.  
  638.           x - extract entire contents or specified  genomes  from
  639.                afile
  640.  
  641.           t - list entire contents or specified genomes in afile
  642.  
  643.      The optional modifiers are:
  644.  
  645.           v - verbose output
  646.  
  647.           o - old. will cause c & r to expect an old-style genome
  648.                file  rather  than assembly code, and x to produce
  649.                old format rather than disassembled  listing,  has
  650.                no effect on t.
  651.  
  652.           1,2...9 - instruction set (defaults to Format: parameter
  653.                      of ascii source or to INST = 1)
  654.  
  655.      Where filen and afile are any legal filenames, genn is  a  3
  656.      character genome label, and size is a decimal integer. (Note
  657.      that tierra(1) expects archives to have names consisting  of
  658.      4 digits, and an extension of .gen, or .tmp.
  659.  
  660. FILES
  661.      GenebankPath/nnnn.gen permanantly saved genomes
  662.      GenebankPath/nnnn.tmp genomes from periodic saves
  663.  
  664. SEE ALSO
  665.      An Approach to the Synthesis of Life
  666.      tierra(1), ov(1X), beagle(1DOS), genio(3), arg(5)
  667.  
  668. BUGS
  669.      Genome extraction and internal  search  functions  could  be
  670.      faster, and will be in the next release.
  671.  
  672. Tierra, V 3.11      Last change: 29 April 1992                  2
  673.  
  674. Please remember that this new form of arg needs the file opcode.map
  675. to be in the current working directory.  Unlike tierra, arg ALWAYS reads
  676. the file opcode.map for the mappings for assembling/disassembling
  677. genebank archives.  This can be a headache, and plans are in the works
  678. for a more user friendly form.
  679.  
  680.   5.3) The Birth-Death Output
  681.  
  682.      During a run, if the DiskOut parameter is non-zero, a record of births
  683. and deaths will be written to disk in the path specified by OutPath, to
  684. files whose names depend on the BrkupSiz parameter.  The format of this
  685. file is a bit cryptic, so it will be explained here.  The file has either
  686. three or four columns of output, depending on whether the GeneBnker parameter
  687. is set.  Three of the columns remain the same either way: 1) elapsed time
  688. since last birth or death event in instructions, output in hexidecimal format.
  689. 2) a `b' or a `d' depending on whether this is a birth or a death.  3) the size
  690. of the creature in instructions, output in decimal format.  If the genebanker
  691. is on, then there will be a fourth column containg the three letter code
  692. identifying the genotype of the creature.  Mutations appear in the
  693. birth-death record as the death of one genotype followed by the birth of
  694. another, with an elapsed time of zero between the two events.
  695.  
  696.      What makes the file cryptic, and also compact, is that columns are
  697. implied to be identical in successive records unless otherwise indicated.
  698. Only the first column, elapsed time since last record, must be printed on
  699. every line, and only the first record must have all three or four columns.
  700. Therefore, if there is a series of successive births, only the first birth
  701. record in the series will contain the b.  Notice that at the beginning of
  702. the file, there will generally be many lines with just one column, because
  703. at the outset, all records are of births of the same size and genotype.
  704.  
  705.      The record of births and deaths is read by the Beagle program, and
  706. converted into a variety of graphic displays: frequency distributions over
  707. time, phase diagrams of the interactions between pairs of sizes or genotypes,
  708. or diversity and related measures over time.  The source code for reading and
  709. interpreting the record of births and deaths is in the bread.c module of the
  710. Beagle source code.
  711.  
  712.   5.4) The Genebank Output
  713.  
  714.      If the GeneBnker parameter is set to a non-zero value, then as each
  715. creature is born, its genome will be sequenced and compared to that of its
  716. mother.  If they are identical, the daughter will be assigned the same name
  717. as the mother.  If they are different, the genome of the daughter will be
  718. compared to the same size genomes held in the RAM genebank.  If the daughter
  719. genome is found in the bank, it will be given the same name as the matching
  720. genome in the bank.  If the daughter genome is not found in the RAM genebank,
  721. it will be compared to any same size genomes stored on the disk that are not
  722. in the RAM genebank.  If the daughter genome is found in the disk genebank,
  723. it will be given the same name as the matching genome in the disk genebank,
  724. and that genome will be brougt back into RAM from the disk.  If the
  725. daughter genome does not match the mother or any genome in either the RAM
  726. or disk banks, then it will be assigned an arbitrary but unique three letter
  727. code for identification.
  728.  
  729.      The genebanker keeps track of the frequency of each size class and each
  730. genotype in the soup.  If a genotype exceeds one of the two genotype frequency
  731. thresholds, SavThrMem or SavThrPop, its assigned name will be made permanent,
  732. and it will be saved to disk in a .gen file.  Genotypes are grouped into
  733. individual files on the basis of size.  For example, all permanent genotypes
  734. of size 80 will be stored together in binary form in a file called 0080.gen.
  735.  
  736.      When the simulator comes down, or when the state of the simulator is
  737. saved periodically during a run, all genotypes present in the soup which have
  738. not been assigned permanent names will be stored in files with a .tmp
  739. extension.  For example, all temporary genotype names of size 45 would be
  740. stored in binary form in a file called 0045.tmp.
  741.  
  742.      The parameter RamBankSiz places a limit on how many genotypes will be
  743. stored in RAM.  If there are more than RamBankSiz genotypes in the RAM bank,
  744. if any of them have permanent genotype names but have gone extinct in the
  745. soup, they will be swapped out to disk into a .gen file.  Genotypes without
  746. permanent names are deleted when they go extinct.  If the number
  747. of living genotypes in the soup is greater than RamBankSiz, then the value
  748. of RamBankSiz is essentially ignored (actually it is treated as if the
  749. value were equal to the number of living genotypes).  Living genotypes are
  750. never swapped out to disk, only extinct ones.  Under DOS, the parameter
  751. RamBankSiz is of little importance, because it is raised if there are more
  752. living genotypes and if the simulator uses all 640K of RAM, RamBankSiz is
  753. lowered so that genotypes will be swapped out to avoid running out of
  754. memory.  Under Unix, this parameter does determine how many genotypes
  755. will be held in the rambank, as long as there are not more than RamBankSiz
  756. living genotypes.
  757.  
  758.      The binary genebank files can be examined with the assembler-disassembler
  759. arg (see the relevant documentation, section 5.2 above).  Also, the Beagle
  760. Explorer program contains utilities for examing the structure of genomes.
  761. One tool condenses the code by pulling out all instructions using templates,
  762. which can reveal the pattern of control flow of the algorithm.  Another
  763. function allows one genome to be used as a probe of another, to compare
  764. the similarities and differences between genomes, or to look for the presence
  765. of a certain sequence in a genome.
  766.  
  767.   5.5) Restarting an Old Run
  768.  
  769.      When you start Tierra by typing tierra to the prompt, you may provide
  770. an optional command line argument, which is the name of the file to use as
  771. input.  This is the file that contains the startup parameters.  The default
  772. file name is soup_in.  When a simulator comes down, and periodically during
  773. a run, the complete state of the machine is saved so that the simulator can
  774. start up again where it left off.  In order to do this you must have the
  775. simulator read the file soup_out on startup.  This means that you must type:
  776.  
  777. tierra soup_out
  778.  
  779.      That is all there is to it.
  780.  
  781.   5.6) The User Interface
  782.  
  783.      There are two interfaces available for Tierra.  The source code and
  784. executables are shipped in a form that is configured for the nicer of the
  785. two, the Basic interface.  However, if you make the appropriate modifications
  786. to the configur.h file, you can recompile with the Standard Output interface
  787. (useful for running Tierra in the background).  Documentation for each of
  788. these interfaces follows.
  789.  
  790.     5.6.1) The Basic Interface
  791.  
  792.       5.6.1.1) The Basic Screen
  793.  
  794.      The Basic frontend features a dynamic interface to the simulation.
  795. The screen area is divided into five basic areas:
  796.  
  797. The STATS area consists of the top two lines of the screen.  This area
  798. displays several important variables, whose values are updated after every
  799. birth:
  800.  
  801. > InstExec  = 75,529993  Cells =  387  Genotypes =  191  Sizes =  23
  802. > Extracted = 0080aad @ 8
  803.  
  804. InstExec  = 75,529993 tells us that the simulation has executed a total of
  805. 75,529,993 instructions.  Cells =  387 tells us that there are presently
  806. 387 adult cells living in the soup.  Genotypes =  191 tells us that there
  807. are presently 191 distinct genotypes of adult cells living in the soup.
  808. Sizes =  23 tells us that there are presently 23 distinct sizes of adult
  809. cells living in the soup.  Extracted =  0080aad @ 8 tells us that the last
  810. genotype to cross one of the frequency thresholds (SavThrMem or SavThrPop)
  811. and get saved to disk and get a permanent name was a creature of size 80
  812. with the name aad, which had a population of 8 adult cells when it crossed
  813. the threshold.
  814.  
  815. The PLAN area displays the values of several variables, whose values are
  816. updated every million instructions:
  817.  
  818. > InstExeC      =     75  Generations  =    188  Thu Apr 30 11:49:46 1992
  819. >     NumCells  =    356  NumGenotypes =    178  NumSizes  =     21
  820. >     AvgSize   =     76  NumGenDG     =    171  NumGenRQ  =    239
  821. >     AvgPop    =    376  Births       =   1007  Deaths    =   1034
  822. >     RateMut   =  10966  RateMovMut   =   1216  RateFlaw  =  97280
  823. >     MaxGenPop =     21  (0078aak)    MaxGenMem =     21 (0078aak)
  824.  
  825. InstExeC = 75 tells us that this set of variables was written when
  826. the simulation had executed 75 million instructions.  Generations = 188
  827. tells us that the simulation had run for about 188 generations at this time.
  828. Thu Apr 30 11:49:46 1992 tells us the actual time and date that this data
  829. was printed.
  830.  
  831. NumCells = 356 tells us that there were 356 adult cells living in the soup.
  832. NumGenotypes = 178 tells us that there were 178 distinct genotypes of adult
  833. cells living in the soup.  NumSizes = 21 tells us that there were 21 distinct
  834. sizes of adult cells living in the soup.
  835.  
  836. AvgSize = 76 tells us that during the last million instructions, the
  837. average size was 76.  NumGenDG = 171 tells us that there are 171 genotypes
  838. that have received permanent names and been saved to disk as .gen files in
  839. the genebank directory gb.  NumGenRQ = 239 tells us that at this time there
  840. were 239 distinct genotypes being held in the genebank in RAM (the ramqueue).
  841.  
  842. AvgPop = 376 tells us that during the last million instructions, the
  843. population was 376 adult cells.  Births = 1007 tells us that during the last
  844. million instructions, there were 1007 births.  Deaths = 1034 tells us that
  845. during the last million instructions, there were 1034 deaths.
  846.  
  847.      RateMut = 10966 tells us that the actual average background (cosmic ray)
  848. mutation rate for the upcoming million instructions will be one mutation per
  849. 10966/2 instructions exectued.  RateMovMut = 1216 tells us that the actual
  850. average move mutation rate (copy error) for the upcoming million instructions
  851. will be one mutation for every 1216/2 instructions copied.  RateFlaw = 97280
  852. tells us that the actual average flaw rate for the upcoming million
  853. instructions will be one flaw for every 97280/2 instructions exectued.  The
  854. reason that these numbers represent twice the average mutation rates is that
  855. they are used to set the range of a uniform random variate determining the
  856. interval between mutations.
  857.  
  858.      MaxGenPop = 21 (0078aak) tells us that at this time, the genotype
  859. with the largest population is 0078aak, and that it has a population of 21
  860. adult cells.  MaxGenMem = 21 (0078aak) tells us that the genotype whose
  861. adult cells occupy the largest share of space in the soup is 0078aak, and
  862. that it has a population of 21 adult cells.
  863.  
  864. The MESSAGE area, for state changes, and Genebank data.  This area serves
  865. many purposes - memory reallocation messages, Genebank information displays,
  866. large interface prompts (eg changing a soup_in variable ).
  867.  
  868. The ERROR area at the second to the last line of the screen.
  869. All simulation errors and exit conditions are passed through this area.
  870.  
  871. The HELP area at the last line of the screen.  This area provides
  872. suggestions for keystroke navigation.  Under DOS it will usually look
  873. like this:
  874.  
  875. >                  Press any Key for menu ...
  876.  
  877. Under Unix it will generally look like this:
  878.  
  879. >                  Press Interupt Key for menu ...
  880.  
  881. Under DOS, pressing any key will get you the menu, under Unix, pressing the
  882. interrupt key (usually Ctrl C) will get you the menu, described in the
  883. next section.
  884.  
  885.       5.6.1.2) The Menu Options
  886.  
  887.      Please note that if the Tierra simulator is started with three arguments,
  888. it will come up with the menu system activated.  The first argument must be
  889. the name of the soup_in file, the third argument is a dummy and anything will
  890. do:  tierra soup_in junk
  891.  
  892. The frontend menu looks like this:
  893.  
  894. > TIERRA |  i-info  v-var  s-save  q-save&quit  Q-quit  m-misc c-continue |->
  895.  
  896.       These options allow for rapid IO from the simulation, in a user friendly
  897. format.  The interface allows transition between any data display mode.  The
  898. features are ativated by a single keypress ("Enter/Return" is usually not
  899. needed).
  900.  
  901. The options are: 
  902.  
  903.             i-info  v-var  s-save  q-save&quit  Q-quit  m-misc c-continue |->
  904.  
  905. i-info: will display some information about creatures stored in the Genebank.
  906.      See below for details.
  907.  
  908. v-var: allows you to alter the value of any of the variables in the
  909.      soup_in file at any point during a run.
  910.  
  911. s-save: will cause the state of the system to be saved at this point, and
  912.      then continue the run.
  913.  
  914. q-save&quit: will cause the state of the system to be saved at this point,
  915.      and then exit from the run.
  916.  
  917. Q-quit: will exit immediately without saving the state of the system.
  918.  
  919. m-misc: pulls up the miscellaneous sub-menu
  920.  
  921. c-continue: continue the run.
  922.  
  923. If you press 'i' for info, from the main TIERRA menu, you are able to select
  924. one of the Genebank (GeneBnker = 1) data display modes:
  925.  
  926. > INFO   |  p-plan  s-size_histo g-gen_histo m-mem_histo z-size_query     |->
  927.  
  928. The second line from the top of the screen will change, providing additional
  929. information on the operating system memory use, or the Tierrian memory use.
  930. At the bottom of the screen, a new list of GeneBank data display options are
  931. available.  All of these modes will try to provide as much data as can fit on
  932. the screen.  These modes are detailed below:
  933.  
  934. Hit the c key to continue (to get out of this level of the menu)
  935.  
  936. The options are:
  937.  
  938.            p-plan  s-size_histo g-gen_histo m-mem_histo z-size_query
  939.  
  940. If you press 'p' from the info menu you get the Plan Display mode: 
  941.  
  942. >Now in Plan Display mode, updated every million time steps
  943.  
  944. This provides the normal statistics every million virual time steps
  945. (this is also an easy way to clear the message area):
  946.  
  947. > InstExeC      =    141  Generations  =    363  Thu Mar 26 15:20:28 1992
  948. >     NumCells  =    483  NumGenotypes =    202  NumSizes  =     27
  949. >     AvgSize   =     53  AvgPop       =    471
  950. >     RateMut   =   5426  RateMovMut   =    848  RateFlaw  =  16960
  951. >     NumGenRQ  =    579  NumGenDM     =      0  NumGenDG  =    400
  952. >     births    =   1210  deaths       =   1125
  953. >     MaxGenPop =     48  (0032aah)    MaxGenMem =     48 (0032aah)
  954.  
  955. The meaning of this information is detailed above.
  956.  
  957.         5.6.1.2.1) The Size Histogram
  958.  
  959. If you press 's' from the info menu, the message area will show a histogram
  960. of frequency distributions of the currently living size classes:
  961.  
  962.    13   1      2 | *
  963.    18   3      9 | **
  964.    19   3      4 | *
  965.    20   2      4 | *
  966.    21   1      3 | *
  967.    22   1      4 | *
  968.    27   3      5 | *
  969.    34   2      4 | *
  970.    35   1      4 | *
  971.    36  34     84 | ****************
  972.    37  70    198 | *************************************
  973.    38  33     92 | ******************
  974.    39   7      9 | **
  975.    40  13     25 | *****
  976.    44   1      2 | *
  977.    45   1      2 | *
  978.    46   2      2 | *
  979.    47   1      4 | *
  980.    49   1      2 | *
  981.    54   1      1 | *
  982.    56   2      3 | *
  983.    70  10     13 | ***
  984.    71  21     42 | ********
  985.    72  24     42 | ********
  986.    73   6      6 | **
  987.    74   7     12 | ***
  988.    75   3      3 | *
  989.    77   2      2 | *
  990.    78   6      7 | **
  991.   109   1      2 | *
  992.  
  993. In the above histogram, the left column of numbers is the size class,
  994. the middle column is the number of genotypes of that size class, and the
  995. right column is the number of living adult cells of that size class.
  996.  
  997.         5.6.1.2.2) The Memory Histogram
  998.  
  999. If you press 'm' from the info menu, the message area will show a histogram
  1000. of frequency distributions of the currently living size classes, by memory
  1001. use:
  1002.  
  1003.    Size  Memory use (size * freq.)
  1004.  
  1005.    18   3    180 | *
  1006.    19   3     76 | *
  1007.    20   2     60 | *
  1008.    21   1     63 | *
  1009.    22   1    110 | *
  1010.    27   3    162 | *
  1011.    31   1     31 | *
  1012.    33   1     33 | *
  1013.    34   2    136 | *
  1014.    35   1    105 | *
  1015.    36  37   3096 | *****************
  1016.    37  69   7141 | *************************************
  1017.    38  34   3610 | *******************
  1018.    39   7    351 | **
  1019.    40  13    960 | *****
  1020.    41   1     41 | *
  1021.    42   1     42 | *
  1022.    43   1     43 | *
  1023.    44   1     44 | *
  1024.    45   1     90 | *
  1025.    46   2     92 | *
  1026.    47   1    235 | **
  1027.    48   1     48 | *
  1028.    49   1     98 | *
  1029.    50   1     50 | *
  1030.    54   1     54 | *
  1031.    56   2    168 | *
  1032.    66   1     66 | *
  1033.    71  22     42 | *
  1034.    72  25     42 | *
  1035.  
  1036. In the above histogram, the left column of numbers is the size class,
  1037. the middle column is the number of genotypes of that size class, and the
  1038. right column is the amount of memory occupied by living adult cells of that
  1039. size class.
  1040.  
  1041.         5.6.1.2.3) The Genotype Histogram
  1042.  
  1043. If you press 'g' from the info menu,  the message area will show a histogram
  1044. of genotype sizes, by specific genotypes:
  1045.  
  1046. Size      Frequency 
  1047.  
  1048.     18aab      3 | ***
  1049.       aac      6 | ******
  1050.     27aab      2 | **
  1051.       aad      3 | ***
  1052.     35aaa      3 | ***
  1053.     36aam      7 | *******
  1054.       aat     39 | **************************************
  1055.       abb      3 | ***
  1056.     37abb     26 | *************************
  1057.       abp      5 | *****
  1058.       abt      6 | ******
  1059.       acm     23 | **********************
  1060.       acn      4 | ****
  1061.     38abb      5 | *****
  1062.       abc      3 | ***
  1063.     40aaj      3 | ***
  1064.       aal      2 | **
  1065.     47aaa      5 | *****
  1066.     49aaa      2 | **
  1067.     56aac      2 | **
  1068.     70aae      2 | **
  1069.       aaf      2 | **
  1070.     71aac      3 | ***
  1071.       aaj      4 | ****
  1072.       aat      3 | ***
  1073.       aav      6 | ******
  1074.     72aai      2 | **
  1075.       aau      3 | ***
  1076.       aax      4 | ****
  1077.     74aac      4 | ****
  1078.  
  1079. In the above histogram, the left column of numbers is the size and genotype
  1080. class, and the right column is the number of living adult cells of that
  1081. genotype class.
  1082.  
  1083.         5.6.1.2.4) The Size Class Information Display
  1084.  
  1085. If you press 'z' from the info menu, you will be prompted for a 
  1086. specific size class to examine, then you will get a list of the most
  1087. common genotypes of that size, with some statistics on them:
  1088.  
  1089. Gene:    #  Mem Errs   Move  Bits
  1090. aae      4   0   1     39    EX      TC      TP      MF      MT      MB
  1091. aaj      1   0   0      0    EX      TC      TP      MF      MT      MB
  1092. aak      1   0   0      0    EX      TC      TP      MF      MT      MB
  1093. aan      1   0   0      0    EX      TC      TP      MF      MT      MB
  1094. aap      1   0   0      0    EX      TC      TP      MF      MT      MB
  1095. aaq      1   0   0      0    EX      TC      TP      MF      MT      MB
  1096. aat     10   0   2     38    EXsofh  TCsofh  TPs     MF      MT      MBsof
  1097. aau      1   0   0      0    EX      TC      TP      MF      MT      MB
  1098. aaw      1   0   0      0    EX      TC      TP      MF      MT      MB
  1099. aax      2   0   0      0    EX      TC      TP      MF      MT      MB
  1100. aay      1   0   0      0    EX      TC      TP      MF      MT      MB
  1101. aba      1   0   0      0    EX      TC      TP      MF      MT      MB
  1102. abb      1   0   0      0    EX      TC      TP      MF      MT      MB
  1103. abc      1   0   0      0    EX      TC      TP      MF      MT      MB
  1104. abe      1   0   7    146    EX      TC      TP      MF      MT      MB
  1105. abi     61   3   2     38    EXsdofh TCsofh  TPs     MFsof   MTsf    MBsdofh
  1106. abk      1   0   2     38    EX      TC      TP      MF      MT      MB
  1107. abl      1   0   0      0    EX      TC      TP      MF      MT      MB
  1108. abm      1   0   0      0    EX      TC      TP      MF      MT      MB
  1109. abw     17   1   2     38    EXsdofh TCsofh  TPs     MF      MT      MBsdofh
  1110. aby      6   0   1     38    EXsdofh TCsof   TPs     MF      MT      MBsdofh
  1111. acb      2   0   0      0    EX      TC      TP      MF      MT      MB
  1112. acd      1   0   0      0    EX      TC      TP      MF      MT      MB
  1113. ace      1   0   0      0    EX      TC      TP      MF      MT      MB
  1114. acf      1   0   0      0    EX      TC      TP      MF      MT      MB
  1115. acg      4   0   2     38    EX      TC      TP      MF      MT      MB
  1116. ach     13   0   2     38    EXsdofh TCsdofh TPs     MFsdofh MTsdf   MBsdofh
  1117. aci      2   0   2     38    EX      TC      TP      MF      MT      MB
  1118. acj      2   0   0      0    EX      TC      TP      MF      MT      MB
  1119.  
  1120. #    = acutal count, populations of adult cells of this genotype 
  1121. Mem  = is the percent of Soup, occupied by adult cells of this genotype
  1122. Err  = is the number of error flag commited,
  1123. Move = number of instructions moved to daughter cell,
  1124. Bits = Watch bits, defined in section: 7)  SOUP_IN PARAMETERS
  1125.  
  1126. 0 values usually represent cases of insufficient data.
  1127.  
  1128. If you press 'm' for misc, from the main TIERRA menu, you will get the
  1129. miscellaneous sub-menu, which looks like the following in unix:
  1130.  
  1131. > MISC |  H-Histo Logging  I-Inject Gene M-Micro Toggle    |->
  1132.  
  1133. and the following in DOS:
  1134.  
  1135. > MISC |  H-Histo Logging  S-DOS Shell  I-Inject Gene M-Micro Toggle    |->
  1136.  
  1137. When this sub-menu is selected, some information is displayed at the top
  1138. of the screen about what variables are #defined:
  1139.  
  1140. VER=3.13 INST=1 PLOIDY=1  ERROR
  1141.  
  1142. This tells us that this is Version 3.13 of the Tierra program, we are using
  1143. Instruction Set 1, that it is a haploid model (Ploidy = 1), and that error
  1144. checking code is included.
  1145.  
  1146. From this menu, you have the following options:
  1147.  
  1148. H-Histo Logging: if you press the H key, it will toggle the logging of any
  1149. histograms you create to the tierra.log file.
  1150.  
  1151. S-DOS shell: (DOS only) this causes you to exit to the DOS prompt, while the
  1152.      simulator remains in the RAM in suspended animation.  You can now do
  1153.      anything that doesn't require a lot of memory.  Be careful that if you
  1154.      change directories, you come back to the current directories before you
  1155.      exit from the shell.  Also, be careful not to do anything that changes
  1156.      the graphics mode.
  1157.  
  1158. I-Inject Gene: inject a genome of your choice from the genebank into the
  1159.      soup of the running simulator.
  1160.  
  1161. M-Micro Toggle: turn on the virtual debugger.  The debugger has three states:
  1162.      delay, keypress, and off.  In delay mode, the debugger will execute one
  1163.      Tierran instruction per second.  In the keypress mode, the debugger will
  1164.      execute one Tierran instruction per keypress.
  1165.  
  1166. c-continue: exit from this sub-menu.
  1167.  
  1168.         5.6.1.2.5) The Virtual Debugger
  1169.  
  1170. The debugger has three states: delay, keypress, and off.  In delay mode, the
  1171. debugger will execute one Tierran instruction per second.  In the keypress
  1172. mode, the debugger will execute one Tierran instruction per keypress.  Once
  1173. you have selected your mode, press c to start the simulator again.  You can
  1174. use this tool to step through the genome of a creature, either to see what
  1175. it does, or to debug a creature that you are writing.  If you want to debug
  1176. a specific creature from start to finish, it is a good idea to put it in
  1177. a soup by itself, and then start the simulator fresh in with the menu
  1178. activated, so that you can start the debugger before the creature has started
  1179. to run.  This is done by giving two arguments when starting Tierra, one must
  1180. be the name of the soup_in file, the second is a dummy argument.  So for
  1181. example, you should type: tierra soup_in junk
  1182.  
  1183. The debugger display in delay mode looks like:
  1184.  
  1185. InstExec  = 11,346072  Cells =  679  Genotypes =  274  Sizes =  26
  1186. VER=3.13 INST=1 PLOIDY=1    MICRO
  1187.  MICRO STEP Mode = keypress
  1188.  
  1189. Cell  1: 55 0045aaa @   12595 Slice=  19  Stack[  12628]
  1190. IP [  12572]( -23    ) = 0x01     nop_1        [  12639]
  1191. AX [  30236]                                   [  12595]
  1192. BX [  12632]                                   [     45] <
  1193. CX [      7]                                   [      0]
  1194. DX [      4]                                   [      0]
  1195. Daughter @ 30199  + 45                         [      0]
  1196.                                                [      0]
  1197.                                                [      0]
  1198.                                                [      0]
  1199.  
  1200.                          Press ESC Key for menu ...
  1201.  
  1202.      The various components of the display are documented in the following:
  1203.  
  1204. Cell  1: 55 0045aaa @   12595 Slice=  19
  1205.  
  1206.      Each creature has associated with it, a cell structure.  The cell
  1207. structures are organized in a two dimensional array.  Cell  1: 55 tells us
  1208. that the structure for the currently active creature is at location 1,55 in
  1209. the cells array.
  1210.  
  1211.      The currently active creature is 0045aaa whose cell starts at address
  1212. 12595 in the soup.  This creature currently has 19 CPU cycles left in its
  1213. time slice.  Note that when the Slice counts down to zero, the slicer will
  1214. swap in the next creature in the slicer queue, and the debugger will display
  1215. the CPU of the next creature.  Therefore when there are more than one
  1216. creature in the soup, it is hard to follow the activity of a single creature,
  1217. since the debugger will be swapped from creature to creature.
  1218.  
  1219. Daughter @ 30199  + 45
  1220.  
  1221.      The currently active creature has allocated a space of 45 instructions
  1222. at address 30199 in the soup, which it presumably will use to make a daughter.
  1223.  
  1224. IP [  12572]( -23    ) = 0x01     nop_1
  1225.  
  1226.      The instruction pointer (IP) of the currently active creature is
  1227. presently located at the soup address 12572.  Notice that this address is
  1228. located 23 instruction BEFORE the start of its own cell.  The number in
  1229. parentheses (-23) is the offset of the IP from the start of the cell.  As
  1230. long as the IP is inside the cell, this offset will be displayed without a
  1231. sign.  If the IP is outside of the cell, the offset will be displayed with
  1232. a + or a - sign.  The current offset of -23 means that the instruction pointer
  1233. of this creature is executing the code of some other creature.  In fact
  1234. 0045aaa is a parasite.  The instruction currently being executed is
  1235. represented in the soup by the hex value 0x01.  The assembler mnemonic of this
  1236. instruction is nop_1, it is a no-operation.
  1237.  
  1238. AX [  30236]
  1239. BX [  12632]
  1240. CX [      7]
  1241. DX [      4]
  1242.  
  1243.      The four CPU registers of the currently active creature contain the
  1244. values indicated above.  Probably, the AX value is the address where the
  1245. creature is writing in its daughter cell, the BX value is the address that
  1246. it is copying from in its own cell, the CX value is the number of
  1247. instructions of the genome remaining to be copied, and the DX value is the
  1248. size of the last template used.
  1249.  
  1250. Stack[  12628]
  1251.      [  12639]
  1252.      [  12595]
  1253.      [     45] <
  1254.      [      0]
  1255.      [      0]
  1256.      [      0]
  1257.      [      0]
  1258.      [      0]
  1259.      [      0]
  1260.  
  1261.      The stack of the currently active creature contains the values indicated
  1262. above.  The stack pointer points at the location indicated by the < sign
  1263. (the top of the stack).  The values on the stack probably include the
  1264. address of the instruction pointer (12628) which was pushed on the stack when
  1265. the parasite called the copy procedure of its host, the address of the end
  1266. of the creature (12639), the address of the beginning of the creature
  1267. (12595), and the size of the creature (45).
  1268.  
  1269.       5.6.1.2.6) The Genome Injector
  1270.  
  1271.      The menu system provides a mechanism for injecting genomes into a
  1272. running simulation.  This tool allows a genome from the genebank to be
  1273. injected into the run at the user's command.  The genome must be in a .gen
  1274. file in the path indicated by the GenebankPath soup_in variable.
  1275.  
  1276.      However, there is a function Inject(), in the genebank.c module, which
  1277. takes a pointer to a genome as an argument.  This function can be used to
  1278. inject genomes from any source.  An interesting use of this function would be
  1279. to facilitate migration of genomes between simulations running on separate
  1280. machines, creating an archipelago.
  1281.  
  1282.     5.6.2) The Standard Output & Interrupt Handler
  1283.  
  1284.      When Tierra is compiled with: #define FRONTEND STDIO, while running it
  1285. produces output to the console that looks something like this:
  1286.  
  1287. Using instruction set (INST) = 1
  1288. TIERRA: LOG = on, Histogram Logging = off 
  1289.  
  1290. sizeof(Instruction)   = 1
  1291. sizeof(Cell)   = 180
  1292. sizeof(MemFr) = 16
  1293.     60000 bytes allocated for soup
  1294.     16380 bytes allocated for cells
  1295.     8000 bytes allocated for MemFr
  1296. tsetup: arrays allocated without error
  1297. beginning of GetNewSoup
  1298. seed = 1
  1299. init of soup complete
  1300. GetNewSoup: loading 0080aaa into cell 0,2
  1301. InstExeC      =      0  Generations  =      0  Wed Apr 29 17:00:06 1992
  1302.     NumCells  =      1  NumGenotypes =      1  NumSizes  =      1
  1303.     AvgSize   =     80  NumGenDG     =      1  NumGenRQ  =      1
  1304.     RateMut   =   6382  RateMovMut   =   1280  RateFlaw  = 102400
  1305. tsetup: soup gotten
  1306. extract: 0080aaa @ 276 v
  1307. InstExeC      =      1  Generations  =      3  Wed Apr 29 17:01:04 1992
  1308.     NumCells  =    376  NumGenotypes =    131  NumSizes  =      8
  1309.     AvgSize   =     79  NumGenDG     =      1  NumGenRQ  =    131
  1310.     AvgPop    =    292  Births       =    995  Deaths    =    620
  1311.     MaxGenPop =    208  (0080aaa)    MaxGenMem =    208 (0080aaa)
  1312.     RateMut   =  12515  RateMovMut   =   1264  RateFlaw  = 101120
  1313. extract: 0080abl @ 8
  1314. InstExeC      =      2  Generations  =      5  Wed Apr 29 17:02:05 1992
  1315.     NumCells  =    380  NumGenotypes =    159  NumSizes  =     12
  1316.     AvgSize   =     79  NumGenDG     =      2  NumGenRQ  =    159
  1317.     AvgPop    =    378  Births       =    847  Deaths    =    843
  1318.     MaxGenPop =    169  (0080aaa)    MaxGenMem =    169 (0080aaa)
  1319.     RateMut   =  12648  RateMovMut   =   1264  RateFlaw  = 101120
  1320. extract: 0080aan @ 8
  1321. extract: 0045aab @ 8
  1322. InstExeC      =      3  Generations  =      8  Wed Apr 29 17:03:17 1992
  1323.     NumCells  =    373  NumGenotypes =    141  NumSizes  =     15
  1324.     AvgSize   =     77  NumGenDG     =      4  NumGenRQ  =    141
  1325.     AvgPop    =    368  Births       =    918  Deaths    =    925
  1326.     MaxGenPop =    144  (0080aaa)    MaxGenMem =    144 (0080aaa)
  1327.     RateMut   =  11794  RateMovMut   =   1232  RateFlaw  =  98560
  1328. extract: 0080adj @ 7
  1329. extract: 0080acu @ 7
  1330. extract: 0080aek @ 8
  1331. extract: 0045aad @ 8
  1332. InstExeC      =      4  Generations  =     10  Wed Apr 29 17:05:11 1992
  1333.     NumCells  =    383  NumGenotypes =    144  NumSizes  =     19
  1334.     AvgSize   =     74  NumGenDG     =      8  NumGenRQ  =    144
  1335.     AvgPop    =    376  Births       =   1071  Deaths    =   1061
  1336.     MaxGenPop =    118  (0080aaa)    MaxGenMem =    118 (0080aaa)
  1337.     RateMut   =  11185  RateMovMut   =   1184  RateFlaw  =  94720
  1338. extract: 0080aad @ 8
  1339.  
  1340.      The meaning of each different kind of information is described below:
  1341.  
  1342. > Using instruction set (INST) = 1
  1343.  
  1344.      Because we are likely to proliferate instruction sets in the near
  1345. future, the system lets us know which one it is using.
  1346.  
  1347. > TIERRA: LOG = on, Histogram Logging = off 
  1348.  
  1349. If the soup_in variable ``Log'' is non-zero, most of the information
  1350. shown in the standard output listing above will be written to the file
  1351. ``tierra.log'' on disk.  Histogram Logging = off indicates that histograms
  1352. viewed through the menu system will not be saved to the log.  This option
  1353. can be toggled so that static histograms are saved to the log.
  1354.  
  1355. > sizeof(Instruction)   = 1
  1356. > sizeof(Cell)   = 180
  1357. > sizeof(MemFr) = 16
  1358.  
  1359.      The size in bytes of each of the main structures, of which the system
  1360. will allocate large arrays at startup.
  1361.  
  1362. >     60000 bytes allocated for soup
  1363. >     16380 bytes allocated for cells
  1364. >     8000 bytes allocated for MemFr
  1365.  
  1366.      The total number of bytes used for each of the three main arrays of
  1367. structures.
  1368.  
  1369. > tsetup: arrays allocated without error
  1370.  
  1371.      Statement indicating that the arrays were allocated without error.
  1372.  
  1373. > beginning of GetNewSoup
  1374.  
  1375.      Statement indicating that the program is entering the GetNewSoup()
  1376. function.
  1377.  
  1378. > seed = 690349257
  1379.  
  1380.      A record of the seed of the random number generator used in this run.
  1381. This can be used to repeat the run if desired.
  1382.  
  1383. > init of soup complete
  1384.  
  1385.      A statement indicating that the soup has been initialized.
  1386.  
  1387. > GetNewSoup: loading 0080aaa into cell 0,2
  1388.  
  1389.      A statement indicating that the system is innoculating the soup with
  1390. a creature of size 80.  There will be a comparable line for every creature
  1391. used in innoculating the soup at startup.  The first creature goes into cell
  1392. 2 of array 0, because cells 0 and 1 are used for other purposes.
  1393.  
  1394. > InstExeC      =      0  Generations  =      0  Wed Apr 29 17:00:06 1992
  1395. >     NumCells  =      1  NumGenotypes =      1  NumSizes  =      1
  1396. >     AvgSize   =     80  NumGenDG     =      1  NumGenRQ  =      1
  1397. >     RateMut   =   6382  RateMovMut   =   1280  RateFlaw  = 102400
  1398. > tsetup: soup gotten
  1399.  
  1400.      These lines indicate the starting conditions of several variables which
  1401. will be explained below.
  1402.  
  1403. > extract: 0080aaa @ 276 v
  1404.  
  1405.      This line indicates that the genotype 0080aaa crossed one of the
  1406. frequency thresholds set in the soup_in file, SavThrMem or SavThrPop,
  1407. and that there were 276 adult creatures of this genotype in the soup
  1408. when this was noted.  However, no creatures are extracted until the
  1409. reaper is activated when the soup becomes full.  This means that 0080aaa
  1410. was not actually extracted at the time that it crossed a threshold, but
  1411. actually much later, when it had a relatively large population.  The v
  1412. after 276 indicates that this was a ``virtual extraction'', which means
  1413. that the genome was not actually saved to disk, since it already has been
  1414. saved to disk.  Anytime a permanent genotype goes extinct, then reappears
  1415. and crosses a threshold, it will experience a virtual extraction, which
  1416. just means that the crossing of the threshold will be reported as an extract
  1417. in standard out and in the tierra.log file (this information can be put
  1418. to good use by the tieout tool: tieout tierra.log ie ex
  1419.  
  1420. > InstExeC      =      1  Generations  =      3  Wed Apr 29 17:01:04 1992
  1421. >     NumCells  =    376  NumGenotypes =    131  NumSizes  =      8
  1422. >     AvgSize   =     79  NumGenDG     =      1  NumGenRQ  =    131
  1423. >     AvgPop    =    292  Births       =    995  Deaths    =    620
  1424. >     MaxGenPop =    208  (0080aaa)    MaxGenMem =    208 (0080aaa)
  1425. >     RateMut   =  12515  RateMovMut   =   1264  RateFlaw  = 101120
  1426.  
  1427.      A statement of this form is printed after every million instructions
  1428. executed by the system.  See the plan() function in the bookeep.c module
  1429. for more details on this.
  1430.  
  1431. > InstExeC      =      1  Generations  =      3  Wed Apr 29 17:01:04 1992
  1432.  
  1433.      InstExeC = 1 tells us that one million instructions have been executed
  1434. in this run.  Generations = 3 tells us that roughly three generations of
  1435. creatures have passed so far during this run.  Wed Apr 29 17:01:04 1992
  1436. tells us the time and date of this record.
  1437.  
  1438. >     NumCells  =    376  NumGenotypes =    131  NumSizes  =      8
  1439.  
  1440.      NumCells = 376 tells us that there were 376 adult cells (and a roughly
  1441. equal number of daughter cells) at this point in the run.  NumGenotypes = 131
  1442. tells us that there were 131 distinct adult genotypes (code sequences) living
  1443. in the soup at the time of this record.  NumSizes = 8 tells us that there
  1444. were eight distinct adult genome sizes (creature code lengths) living in the
  1445. soup at this time.
  1446.  
  1447. >     AvgSize   =     79  NumGenDG     =      1  NumGenRQ  =    131
  1448.  
  1449.      AvgSize = 79 tells us that the average size of all the adult creatures
  1450. living in the soup at this time was 79 instructions.  NumGenDG = 1 tells us
  1451. that there is one genotype that has received a permanent name and been saved
  1452. to disk as .gen files in the genebank directory gb.  NumGenRQ = 131 tells us
  1453. that at this time there were 131 distinct genotypes being held in the genebank
  1454. in RAM (the ramqueue).
  1455.  
  1456. >     AvgPop    =    292  Births       =    995  Deaths    =    620
  1457.  
  1458. AvgPop = 292 tells us that during the last million instructions the average
  1459. population was 292 adult cells.  Births = 995 tells us that during the last
  1460. million instructions, there were 995 births.  Deaths = 620 tells us that
  1461. during the last million instructions, there were 620 deaths.
  1462.  
  1463. >     MaxGenPop =    208  (0080aaa)    MaxGenMem =    208 (0080aaa)
  1464.  
  1465.      MaxGenPop =    208  (0080aaa) tells us that at this time, the genotype
  1466. with the largest population is 80aaa, and that it has a population of 208
  1467. adult cells.  MaxGenMem =    208 (0080aaa) tells us that the genotype whose
  1468. adult cells occupy the largest share of space in the soup is 80aaa, and that
  1469. it has a population of 208 adult cells.
  1470.  
  1471. >     RateMut   =  12515  RateMovMut   =   1264  RateFlaw  = 101120
  1472.  
  1473.      RateMut = 12515 tells us that the actual average background (cosmic ray)
  1474. mutation rate for the upcoming million instructions will be one mutation per
  1475. 12515/2 instructions exectued.  RateMovMut = 1264 tells us that the actual
  1476. average move mutation rate (copy error) for the upcoming million instructions
  1477. will be one mutation for every 1264/2 instructions copied.  RateFlaw = 101120
  1478. tells us that the actual average flaw rate for the upcoming million
  1479. instructions will be one flaw for every 101120/2 instructions exectued.  The
  1480. reason that these numbers represent twice the average mutation rates is that
  1481. they are used to set the range of a uniform random variate determining the
  1482. interval between mutations.
  1483.  
  1484. > extract: 0080abl @ 8
  1485.  
  1486.      This is a real extraction, as indicated by the absence of a v after
  1487. the 8.  This genotype, 0080abl, crossed the threshold frequency with a
  1488. population of 8 adult creatures, its name was made permanent, and its genome
  1489. was saved to disk.
  1490.  
  1491.      When Tierra is running in the foreground it is possible to interrupt
  1492. it on either DOS or UNIX, usually by typing Ctrl C (^C).  When you do this
  1493. you will get a brief message listing your options, which looks something
  1494. like this:
  1495.  
  1496. ==========================================================
  1497. TIERRA: SIGINT Handler
  1498. ---------------------------------------------------------
  1499. InstExe.m    =      6  InstExec.i = 478414  NumCells =  362
  1500. NumGenotypes =    145  NumSizes   =     20
  1501. ---------------------------------------------------------
  1502.         Key     Function
  1503.  
  1504.         i       Information on simulation
  1505.         v       Change a soup_in variable
  1506.         S       Execute a system Shell
  1507.         s       Save the soup
  1508.         q       Save the soup & quit
  1509.         Q       Quit/Abort simulation
  1510.         c       To Continue simulation
  1511. ---------------------------------------------------------
  1512. TIERRA | i-info v-var s-save S-shell q-save&quit Q-quit c-continue |->
  1513.  
  1514. DOS only: Coreleft, is the amount of free memory above the highest block of
  1515. allocated memory, within the first 640K of system memory.  This is a clue to
  1516. how much memory remains for use by the simulator.
  1517.  
  1518. Unix only: If ALCOMM has been defined at compile time, VPORT is the value of
  1519. the socket for ALmond data communication.
  1520.  
  1521.      You must now choose one of the options by typing one of the corresponding
  1522. letters: ivSsqQc.  When you type the letter, the simulator will either prompt
  1523. you for more input or do the requested operation.  
  1524.  
  1525. The options are: 
  1526.  
  1527.      i-info v-var s-save S-shell q-save&quit Q-quit c-continue |->
  1528.  
  1529. i-info: will display some information about creatures stored in the Genebank.
  1530.      See below for details.
  1531.  
  1532. v-var: allows you to alter the value of any of the variables in the
  1533.      soup_in file at any point during a run.
  1534.  
  1535. s-save soup: will cause the state of the system to be saved at this point, and
  1536.      then continue the run.
  1537.  
  1538. S-Shell: (DOS only) this causes you to exit to the DOS prompt, while the
  1539.      simulator remains in the RAM in suspended animation.  You can now do
  1540.      anything that doesn't require a lot of memory.  Be careful that if you
  1541.      change directories, you come back to the current directories before you
  1542.      exit from the shell.  Also, be careful not to do anything that changes
  1543.      the graphics mode.
  1544.  
  1545. q-save&quit: will cause the state of the system to be saved at this point,
  1546.      and then exit from the run.
  1547.  
  1548. Q-quit: will exit immediately without saving the state of the system.
  1549.  
  1550. c-continue: continue the run.
  1551.  
  1552. i-info:  Choosing this option produces a sub-menu:
  1553.  
  1554. ---------------------------------------------------------
  1555.         s       Spectrum of all Size Classes
  1556.         m       Spectrum of Size Classes, by memory use
  1557.         g       Spectrum of Size Classes, by geneotype
  1558.         z       Break down of a specific Size Class
  1559.                 Any other key to main menu ...
  1560. ---------------------------------------------------------
  1561.  
  1562.      These options are documented under the BASIC frontend above.
  1563.  
  1564.     5.6.3) The tierra.log file
  1565.  
  1566.      If the soup_in variable:
  1567.  
  1568. Log = 1        0 = no log file, 1 = write log file
  1569.  
  1570. is set to a non-zero value, a file named tierra.log will be written to
  1571. the current directory.  This file contains in abbreviated form, much the
  1572. same information that is contained in the Standard Output frontend.  An
  1573. example of the output to this file follows:
  1574.  
  1575. TIERRA: LOG = on, Histogram Logging = off 
  1576.  
  1577. sizeof(Instruction)   = 1
  1578. sizeof(Cell)   = 180
  1579. sizeof(MemFr) = 16
  1580.     60000 bytes allocated for soup
  1581.     16380 bytes allocated for cells
  1582.     8000 bytes allocated for MemFr
  1583. tsetup: arrays allocated without error
  1584. beginning of GetNewSoup
  1585. seed = 1
  1586. init of soup complete
  1587. GetNewSoup: loading 0080aaa into cell 0,2
  1588.  
  1589. ie0 gn0 Wed Apr 29 16:12:08 1992
  1590. nc1 ng1 ns1
  1591. as80 rq1 dg1
  1592. rm6382 mm1280 rf102400
  1593.  
  1594. tsetup: soup gotten
  1595. ex = 0080aaa @ 276 v
  1596.  
  1597. ie1 gn3 Wed Apr 29 16:13:14 1992
  1598. nc376 ng131 ns8
  1599. as79 rq131 dg1
  1600. bi995 de620 ap292
  1601. mp208 @ 0080aaa mg208 @ 0080aaa
  1602. rm12515 mm1264 rf101120
  1603.  
  1604. ex = 0080abl @ 8
  1605.  
  1606. ie2 gn5 Wed Apr 29 16:14:17 1992
  1607. nc380 ng159 ns12
  1608. as79 rq159 dg2
  1609. bi847 de843 ap378
  1610. mp169 @ 0080aaa mg169 @ 0080aaa
  1611. rm12648 mm1264 rf101120
  1612.  
  1613. ex = 0080aan @ 8
  1614. ex = 0045aab @ 8
  1615.  
  1616. ie3 gn8 Wed Apr 29 16:15:32 1992
  1617. nc373 ng141 ns15
  1618. as77 rq141 dg4
  1619. bi918 de925 ap368
  1620. mp144 @ 0080aaa mg144 @ 0080aaa
  1621. rm11794 mm1232 rf98560
  1622.  
  1623. ex = 0080adj @ 7
  1624. ex = 0080acu @ 7
  1625. ex = 0080aek @ 8
  1626. ex = 0045aad @ 8
  1627.  
  1628. ie4 gn10 Wed Apr 29 16:17:27 1992
  1629. nc383 ng144 ns19
  1630. as74 rq144 dg8
  1631. bi1071 de1061 ap376
  1632. mp118 @ 0080aaa mg118 @ 0080aaa
  1633. rm11185 mm1184 rf94720
  1634.  
  1635.      Because this file is of essentially the same form as the standard
  1636. output, only the abbreviations will be documented here.  Refer to the
  1637. documentation of the Standard Output to interpret the meaning of this file.
  1638.  
  1639. ie = InstExeC; gn = Generations; nc = NumCells; ng = NumGenotypes;
  1640. ns = NumSizes; as = AvgSize; rq = NumGenRQ; dg = NumGenDG;
  1641. bi = Births; de = Deaths; ap = AvgPop; mp = MaxGenPop; mg = MaxGenMem.
  1642. rm = RateMut; mm = RateMovMut; rf = RateFlaw;
  1643.  
  1644. 6)  LISTING OF DISTRIBUTION FILES
  1645.  
  1646. The distribution includes the following files:
  1647.  
  1648. arg.c - the main module for the assembler/disassembler, originally written by
  1649.      Tom Uffner.  This program converts ascii assembler files into binary
  1650.      files which can be executed by the Tierran virtual computer.
  1651.  
  1652. arg.prj - the Turbo C V 2.0 project file for compiling the
  1653.      assember/disassembler.
  1654.  
  1655. argpp.prj - the Borland C++ project file for compiling the
  1656.      assember/disassembler.
  1657.  
  1658. argv2.prj - the Turbo C V 2.0 project file for compiling the
  1659.      assember/disassembler.
  1660.  
  1661. arginst.h - a file containing a structure used by arg.c to provide a default
  1662.      maping of assembler mnemonics to executable opcodes.  This mapping is
  1663.      overridden by the mapping in the opcode.map file.
  1664.  
  1665. bookeep.c - source code for bookeeping routines, which keep track of how many
  1666.      of what kind of creatures are in the soup, and other stuff like that.
  1667.  
  1668. ccarg - a file for compiling the assembler/disassembler on unix systems.
  1669.      You must change the protection on this file to make it executable:
  1670.      chmod +x ccarg
  1671.  
  1672. cctierra - a file for compiling Tierra on unix systems.
  1673.      You must change the protection on this file to make it executable:
  1674.      chmod +x cctierra
  1675.  
  1676. clearrun - a Unix shell script for cleaning up an old run in preparation
  1677.      for a new run (or you can just use it to remove files generated by
  1678.      a run, to get you disk space back).  You must change the protection
  1679.      on this file to make it executable: chmod +x clearrun
  1680.  
  1681. clearrun.bat - a DOS batch file for cleaning up an old run in preparation
  1682.      for a new run (or you can just use it to remove files generated by
  1683.      a run, to get you disk space back).
  1684.  
  1685. configur.h - a file for configuring Tierra.  You probably won't need to
  1686.      touch this unless you get into advanced stuff.
  1687.  
  1688. declare.h - all global variables are declared in this file, except those
  1689.      whose values are set by soup_in.  Those globals are declared in
  1690.      soup_in.h.  declare.h is included by tierra.c which contains the main
  1691.      function.
  1692.  
  1693. depend - a listing of interdependencies of the source code files (out of date)
  1694.  
  1695. extern.h - all global variables are delcared as extern in this file, and this
  1696.      file is included by all *.c files except tierra.c which includes
  1697.      delcare.h instead.
  1698.  
  1699. extract.c - functions for extracting creatures from the soup and saving their
  1700.      genomes to disk.
  1701.  
  1702. frontend.c - functions for handling input/output for Tierra.  This stuff was
  1703.      written by Dan Pirone.  This module contains basic data reporting
  1704.      functions, and includes one of the following:
  1705.   tstdio.c - low level IO for standard IO, simple, and good for debugging.
  1706.   tcurses.c - advanced IO for unix, based on "standard" curses calls,
  1707.      Please see the manual pages on curses for the nitty gritty details.
  1708.   tturbo.c - advanced IO for the Turbo C / DOS environment.
  1709.      On machines with EGA or VGA harware, 43/50 lines modes are used.
  1710.  
  1711. genebank.c - functions for managing the genebank.  This module has benefited
  1712.      from a lot of work by Tom Uffner.
  1713.  
  1714. genio.c - functions for input/output of creatures.  This stuff is also used
  1715.      by arg.c, the assembler/disassembler.  This module has benefited from
  1716.      a lot of work by Tom Uffner.
  1717.  
  1718. instruct.c - this module contains generalized executable functions.  These
  1719.      generalized functions are mapped to specific functions by the parsing
  1720.      functions in the parse.c module.
  1721.  
  1722. memalloc.c - functions for handling memory allocation in the soup, the stuff
  1723.      that ``cell membranes'' are made of.
  1724.  
  1725. parse.c - the parsing functions interpret the executable code of the
  1726.      creatures, and map it onto the executable functions contained in the
  1727.      instruct.c module.
  1728.  
  1729. portable.c - functions for portability between operating systems.
  1730.  
  1731. portable.h - definitions for portability between operating systems and
  1732.      architectures.
  1733.  
  1734. probe.c - a separate tool for observing the genebank, documented in probe.doc.
  1735.  
  1736. prototyp.h - all functions in Tierra are prototyped here.
  1737.  
  1738. queues.c - queue management functions for the slicer and reaper queues. 
  1739.  
  1740. rnd_inst.c - a separate tool for randomizing the mapping of opcodes to
  1741.      instructions, documented in rnd_inst.doc
  1742.  
  1743. slicers.c - interchangeable slicer functions.  This file contains some
  1744.      experiments in the allocation of cpu time to creatures.  This is
  1745.      an interesting thing to play with.
  1746.  
  1747. soup_in - the ascii file read by Tierra on startup, which contains all
  1748.      the global parameters that determine the environment.
  1749.  
  1750. soup_in.h - this file defines the default values of all the soup_in variables,
  1751.      and defines the instruction set by mapping the assember mnemonics to the
  1752.      opcodes, parser functions, and executables.
  1753.  
  1754. tieout.c - a separate tool for observing the contents of the tierra.log file
  1755.      documented in tieout.doc.
  1756.  
  1757. tieout.doc - documentation of the tieout tool.
  1758.  
  1759. tieout.exe - the DOS distribution also includes the executable version of
  1760.      the tieout tool, so that it does not have to be compiled.
  1761.      See tieout.doc.
  1762.  
  1763. tierra.c - this file contains the main function, and the central code
  1764.      driving the virtual computer.
  1765.  
  1766. tierra.doc - this file, on line documentation.
  1767.  
  1768. tierra.exe - the DOS distribution includes the executable version of the
  1769.      Tierra program, so that it does not have to be compiled.
  1770.  
  1771. tierra.h - this file contains all the structure definitions.  It is a good
  1772.      source of documentation for anyone trying to understand the code.
  1773.  
  1774. tierra.prj - the Turbo C V 2.0 project file for compiling Tierra.
  1775.  
  1776. tierrapp.prj - the Borland C++ project file for compiling Tierra.
  1777.  
  1778. tierrav2.prj - the Turbo C V 2.0 project file for compiling Tierra.
  1779.  
  1780. tmonitor.c - this file contains support calls for the ALmond tool.
  1781.  
  1782. trand.c - random number generation routines from Numerical Recipes in C.
  1783.  
  1784. tsetup.c - routines called when Tierra starts up and comes down.  Tom Uffner
  1785.      has put some work into this module as well.
  1786.  
  1787. gb: - a subdirectory containing the genomes of the creatures saved
  1788.      during a run.
  1789.  
  1790. 0080aaa.tie - the ancestor, written by a human, mother of all other creatures.
  1791.  
  1792. 0022abn.tie - the smallest non-parasitic self-replicating creature to evolve.
  1793.  
  1794. 0045aaa.tie - the archtypical parasite.
  1795.  
  1796. 0046aaa.tie - a symbiont with 0064aaa.  These two were created by hand,
  1797.      by splitting 0080aaa into two parts.
  1798.  
  1799. 0064aaa.tie - a symbiont with 0046aaa.  These two were created by hand,
  1800.      by splitting 0080aaa into two parts.
  1801.  
  1802. 0072etq.tie - a phenomenal example of optimization through evolution,
  1803.      involving the unrolling of the copy loop.
  1804.  
  1805.      At the time of this writing, only a single run, of a billion
  1806. instructions, has been analyzed at the level of detail to reveal the specifics
  1807. of the ecological arms race that took place.  That information is presented
  1808. in the manuscripts cited above.  This run can be seen on the video, available
  1809. from Media Magic, P.O. Box 507, Nicasio, CA 94946.  Some of the major players
  1810. in that run are listed below, and included in the software distribution,
  1811. in the chronological order of their appearance:
  1812.  
  1813. 0079aca.tie - this creature dominated the soup at the time that a major
  1814.      optimization took place, resulting in 0069aaa and its relatives.
  1815.  
  1816. 0069aaa.tie - this fully self-replicating (non-parasitic) creature appeared
  1817.      at a time that the dominant self-replicating size class was 79.  Thus
  1818.      this creature was a hopeful monster.  It managed to shave 10 instructions
  1819.      off of the genome in a single genetic change.  Actually this creature
  1820.      claims that its immediate ancestor (parental genotype) was 0085aal.
  1821.      If this is true, then it actually shaved 16 instructions off its size
  1822.      in a single genetic event.  Unfortunately, 0085aal was not preserved
  1823.      in the fossil record.
  1824.  
  1825. 0069acm.tie - this host creature co-dominates the soup for a time, with the
  1826.      parasite 0031acw.
  1827.  
  1828. 0031acw.tie - this parasite co-dominates the soup for a time, with the
  1829.      host 0069acm.
  1830.  
  1831. 0070aaw.tie - while 0069acm and 0031acw co-dominate the soup, this
  1832.      creature, which is the first hyper-parasite, surges up.  It and its
  1833.      relatives drive the parasites to extinction.
  1834.  
  1835. 0061aag.tie - this hyper-parasites dominates at the time that the first
  1836.      social creatures appear.
  1837.  
  1838. 0061aai.tie - this is the first social hyper-parasite to surge up.  It is
  1839.      social by virtue of using a template in its tail to jump back to its
  1840.      head.  This only works when it occurs in close aggregations of same
  1841.      kind creatures.
  1842.  
  1843. 0061aoq.tie - this is the second social hyper-parasite to surge up.  It
  1844.      operates on the basis of a completely different social mechanism from
  1845.      0061aai.  In this creature the basis of cooperation is that the
  1846.      template used to search for its tail, does not match to the tail
  1847.      template.  However, it two of these creatures abut in memory, the
  1848.      union of the tail template of one with the head template of the next,
  1849.      forms the template that is used to identify the tail.  This algorithm
  1850.      also only works when the creatures occur in aggregations.  However, this
  1851.      mechanism is more fragile than that used by 0061aai.  For 0061aoq, the
  1852.      two cooperating creatures must exactly abut.  For 0061aai, the two
  1853.      cooperating creatures may have some space between them.  Therefore
  1854.      it is not surprising that the social mechanism of 0061aai is the one
  1855.      prevailed.
  1856.  
  1857. 0061acg.tie - this is the social hyper-parasite that dominated at the time
  1858.      that cheaters invaded.
  1859.  
  1860. 0027aab.tie - this is the dominant cheater that invaded against the social
  1861.      hyper-parasites.
  1862.  
  1863. 0080.gen - the DOS distribution also includes the assembled binary version of
  1864.      the 0080aaa.tie file, so that Tierra can be run without having to
  1865.      assemble the genome file first.
  1866.  
  1867. 0022gen.vir, 0027gen.vir, 0031gen.vir, 0045gen.vir, 0046gen.vir, 0061gen.vir,
  1868. 0064gen.vir, 0069gen.vir, 0070gen.vir, 0072gen.vir, 0079gen.vir, 0080gen.vir
  1869.      - the DOS distribution also includes virgin copies of the binary 00XX.gen
  1870.      genome files.  These are kept in reserve so that they can be copied to
  1871.      the .gen files whenever a new run is being started.  0080gen.vir is
  1872.      automatically copied to 0080.gen by the clearrun and clearrun.bat files.
  1873.  
  1874. arg.exe - the DOS distribution includes the executable version of the
  1875.      assembler/disassembler.
  1876.  
  1877. opcode.map - a file read by Tierra, Beagle, and arg upon startup.  This
  1878.      file determines the correspondence between opcodes and the associated
  1879.      machine instructions.  This is a simple way to play with the definition
  1880.      of the physics and chemistry of the simulator.
  1881.  
  1882. opcode.vir - a virginal copy of opcode.map.  You may use the rnd_inst tool
  1883.      to create new opcode maps, or you may create them by hand.  You will
  1884.      have to name the new versions opcode.map in order to assemble the
  1885.      genomes based on the new mapping.  You can keep opcode.vir in reserve.
  1886.  
  1887. probe.doc - documentation of the probe tool.
  1888.  
  1889. probe.exe - the DOS distribution includes the executable version of the
  1890.      probe program, so that it does not have to be compiled.
  1891.  
  1892. rnd_inst.doc - documentation of the run_inst tool.
  1893.  
  1894. rnd_inst.exe - the DOS distribution includes the executable version of the
  1895.      rnd_inst program, so that it does not have to be compiled.
  1896.  
  1897. td: - a subdirectory where a complete record of births and deaths will
  1898.      be written.
  1899.  
  1900. break.1 - a file containing a record of births and deaths.  A dummy file is
  1901.      provided to hold the space.
  1902.  
  1903. diverse.c - a separate tool for observing the diversity of genotypes and
  1904.      size classes in a run, documented in diverse.doc.
  1905.  
  1906. diverse.doc - documentation of the diversity tool.
  1907.  
  1908. diverse.exe - the DOS distribution also includes the executable version of
  1909.      the diversity index tool, so that it does not have to be compiled.
  1910.      See diverse.doc.
  1911.  
  1912. fragment.c - a separate tool for peparing fragments of a run for observation
  1913.      by the beagle tool, documented in beagle.doc.
  1914.  
  1915. fragment.exe - the DOS distribution also includes the executable version of
  1916.      the fragment tool.  See beagle.doc.
  1917.  
  1918. run_info.c -  a separate tool for peparing the output of a run for observation
  1919.      by the beagle tool, documented in beagle.doc.
  1920.  
  1921. run_info.exe - the DOS distribution also includes the executable version of
  1922.      the run_info tool.  See beagle.doc.
  1923.  
  1924. 7)  SOUP_IN PARAMETERS
  1925.  
  1926. A typical soup_in file looks like the following:
  1927.  
  1928. /* begin soup_in file */
  1929.  
  1930. # tierra core: 17-4-92 
  1931.  
  1932. # observational parameters:
  1933.  
  1934. BrkupSiz = 1024      size of output file in K, named break.1, break.2 ...
  1935. CumGeneBnk = 0    Use cumulative gene files, or overwrite
  1936. debug = 0               0 = off, 1 = on, printf statements for debugging
  1937. DiskOut = 1            output data to disk (1 = on, 0 = off)
  1938. GeneBnker = 1   turn genebanker on and off
  1939. GenebankPath = gb/  path for genebanker output
  1940. hangup = 0            0 = exit on error, 1 = hangup on error for debugging
  1941. Log = 1        0 = no log file, 1 = write log file
  1942. MaxFreeBlocks = 700     initial number of structures for memory allocation
  1943. OutPath = td/  path for data output
  1944. RamBankSiz = 1000 array size for genotypes in ram, use with genebanker
  1945. SaveFreq = 50        frequency of saving core_out, soup_out and list
  1946. SavMinNum = 2     minimum number of individuals to save genotype
  1947. SavThrMem = .04  threshold memory occupancy to save genotype
  1948. SavThrPop = .04  threshold population proportion to save genotype
  1949. WatchExe = 0     mark executed instructions in genome in genebank
  1950. WatchMov = 0     set mov bits in genome in genebank
  1951. WatchTem = 0     set template bits in genome in genebank
  1952.  
  1953. # environmental variables:
  1954.  
  1955. alive = 500            how many millions of instruction will we run
  1956. DistFreq = .3       frequency of disturbance, factor of recovery time
  1957. DistProp = .2       proportion of population affected by distrubance
  1958. DivSameGen = 0 cells must produce offspring of same genotype, to stop evolution
  1959. DivSameSiz = 0 cells must produce offspring of same size, to stop size change
  1960. DropDead = 5 stop system if no reproduction in the last x million instructions
  1961. GenPerBkgMut = 16 mutation rate control by generations ("cosmic ray")
  1962. GenPerFlaw = 64       flaw control by generations
  1963. GenPerMovMut = 8    mutation rate control by generations (copy mutation)
  1964. IMapFile = opcode.map map of opcodes to instructions, file in GenebankPath
  1965. MateProb = 0.2  probability of mating at each mal
  1966. MateSearchL = 5 multiple of avgsize to search 0 = no limit
  1967. MateSizeEp = 2 size epsilon for potential mate
  1968. MateXoverProp = 1.0 proportion of gene to secect for crossover point
  1969. MaxMalMult = 3        multiple of cell size allowed for mal()
  1970. MemModeFree = 0  read, write, execute protection for free memory
  1971. MemModeProt = 2 rwx protect mem: 1 bit = execute, 2 bit = write, 4 bit = read
  1972. MinCellSize = 8       minimum size for cells
  1973. MinTemplSize = 1       minimum size for templates
  1974. MovPropThrDiv = .7       minimum proportion of daughter cell filled by mov
  1975. new_soup = 1          1 = this a new soup, 0 = restarting an old run
  1976. NumCells = 3      number of creatures and gaps used to inoculate new soup
  1977. PhotonPow = 1.5         power for photon match slice size
  1978. PhotonWidth = 8   amount by which photons slide to find best fit
  1979. PhotonWord = chlorophill  word used to define photon
  1980. ReapRndProp = .0 top prop of reaper que to reap from
  1981. SearchLimit = 5
  1982. seed = 0 seed for random number generator, 0 uses time to set seed
  1983. SizDepSlice = 0  set slice size by size of creature
  1984. SlicePow = 1    set power for slice size, use when SizDepSlice = 1
  1985. SliceSize = 25    slice size when SizDepSlice = 0
  1986. SliceStyle = 2   choose style of determining slice size
  1987. SlicFixFrac = 0   fixed fraction of slice size
  1988. SlicRanFrac = 2   random fraction of slice size
  1989. SoupSize = 50000 size of soup in instructions
  1990.  
  1991. 0080aaa
  1992. 0045aaa
  1993. 0080aaa
  1994.  
  1995. /* end soup_in file */
  1996.  
  1997.      The ordering of parameters is not important, except that the creatures
  1998. used to innoculate the soup must be listed at the end of the file, with no
  1999. blank lines between the creatures (if there is more than one).  Parameters
  2000. that are not listed in the soup_in or soup_out files, default to the values
  2001. set in the soup_in.h file.  The parameter names must begin at the first
  2002. character of the line (no spaces or other characters may appear at the
  2003. beginning of the line before the parameter name).
  2004.  
  2005. The meaning of each of these parameters is explained below:
  2006.  
  2007. # tierra core: 17-4-92 
  2008.  
  2009. # observational parameters:
  2010.  
  2011.      These lines are comments.  The code that reads the soup_in and soup_out
  2012. files skips all blank lines, and all lines beginning with the # character.
  2013. The input parameters have been divided into two groups, the ``observational
  2014. parameters'' and the ``environmental variables''.  The observational
  2015. parameters are listed first, and they do not affect the course of events
  2016. in the run.  They only affect what kind of information we extract, and how
  2017. and where it is stored.
  2018.  
  2019. BrkupSiz = 1024      size of output file in K, named break.1, break.2 ...
  2020.  
  2021.      If this value is set to zero (0) the record of births and deaths will
  2022. be written to a single file named tierra.run.  However, if BrkupSiz has a
  2023. non-zero value, birth and death records will be written to a series of files
  2024. with the names break.1, break.2, etc.  Each of these files will have the
  2025. size specified, in K (1024 bytes).  The value 1024 indicates that the
  2026. break files will each be one megabytes in size.  The output file(s) will
  2027. be in the path specified by OutPath (see below).  See also DiskOut.
  2028. Please note that these files can get quite large.
  2029.  
  2030. CumGeneBnk = 0  0 = start new genebank, 1 = use cumulative genebank
  2031.  
  2032.      This parameter gives us the option of starting a fresh genebank, or
  2033. of working with a cumulative genebank.  If you are planning to compare the
  2034. results of a series of runs, you should consider using a cumulative
  2035. genebank.  With a cumulative genebank, if the identical genotypes appear in
  2036. successive runs, they will have identical names.
  2037.  
  2038. debug = 0               0 = off, 1 = on, printf statements for debugging
  2039.  
  2040.      This is used during code development, to turn on and off print statements
  2041. for debugging purposes.
  2042.  
  2043. DiskOut = 1            output data to disk (1 = on, 0 = off)
  2044.  
  2045.      If this parameter is set to zero (0), no birth and death records will
  2046. be saved.  Any other value will cause birth and death records to be saved
  2047. to a file whose name is discussed under BrkupSiz above, in the path discussed
  2048. under OutPath below.
  2049.  
  2050. GeneBnker = 1   turn genebanker on and off
  2051.  
  2052.      The parameter turns the genebanker on and off.  The value zero turns
  2053. the genebanker off, any other value turns it on.  With the genebanker off,
  2054. the record of births and deaths will contain the sizes of the creatures,
  2055. but not their genotypes.  Also no genomes will be saved in the genebank.
  2056. When the genebanker is turned on, the record of births and deaths will
  2057. contain a three letter unique name for each genotype, as well as the size
  2058. of the creatures.  Also, any genome whose frequency exceeds the thresholds
  2059. SavThrMem and SavThrPop (see below) will be saved to the genebank, in
  2060. the path indicated by GenebankPath (see below).
  2061.  
  2062. GenebankPath = gb/  path for genebanker output
  2063.  
  2064.      This is a string variable which describes the path to the genebank
  2065. where the genomes will be saved.  The path name should be terminated by
  2066. a forward slash.
  2067.  
  2068. hangup = 0            0 = exit on error, 1 = hangup on error for debugging
  2069.  
  2070.      If an error occurs which is serious enough to bring down the system,
  2071. having hangup set to 1 will prevent the program from exiting.  In this case,
  2072. the program will hang in a simple loop so that it remains active for
  2073. debugging purposes.  Set this parameter only if you are running the
  2074. simulator under a debugger.
  2075.  
  2076. Log = 1        0 = no log file, 1 = write log file
  2077.  
  2078.     If Log is non zero, a disk file called tierra.log will be written
  2079. mirroring all major simulation states.  If disk space is a problem,
  2080. please set Log = 0. This can be changed at any point in the run.
  2081.  
  2082. MaxFreeBlocks = 700     initial number of structures for memory allocation
  2083.  
  2084.      There is an array of structures used for the virtual memory allocator.
  2085. This parameter sets the initial size of the allocated array, at startup.
  2086.  
  2087. OutPath = td/  path for data output
  2088.  
  2089.      The record of births and deaths will be written to files in a directory
  2090. specified by OutPath.  See BrkupSiz above for a discussion of the name of
  2091. the file(s) containing the birth and death records.
  2092.  
  2093. RamBankSiz = 1000 array size for genotypes in ram, use with genebanker
  2094.  
  2095.      The parameter RamBankSiz places a limit on how many genotypes will be
  2096. stored in RAM.  When the number of genotypes in the genebank exceeds the
  2097. RamBankSiz, if there are genotypes with permanent names in the rambank that
  2098. are extinct in the soup, they will be swapped out to disk as .gen files.
  2099. However, if the number of living genotypes in the soup is greater than
  2100. RamBankSiz, then the value of RamBankSiz is essentially ignored (actually it
  2101. is treated as if the value were equal to the number of living genotypes).
  2102. Living genotypes are never swapped out to disk, only extinct ones.  Under DOS,
  2103. the parameter RamBankSiz is of little importance, because it is raised if
  2104. there are more living genotypes, and if the simulator uses all 640K of RAM,
  2105. RamBankSiz is lowered so that genotypes will be swapped out to avoid running
  2106. out of memory.  Under DOS, with a SoupSize of 60,000, the rambank can hold
  2107. somewhere between 600 and 800 genotypes.  If there are more than that, the
  2108. system will thrash terribly, swapping genomes in and out from disk to RAM
  2109. and back.  Under Unix, this parameter does determine how many genotypes
  2110. will be held in the rambank, as long as there are not more than RamBankSiz
  2111. living genotypes.
  2112.  
  2113. SaveFreq = 50        frequency of saving core_out, soup_out and list
  2114.  
  2115.      Every SaveFreq million instructions, the complete state of the
  2116. virtual machine is saved.  This is a useful feature for long runs, so that
  2117. the system can be restarted if it is interrupted for some reason.
  2118.  
  2119. SavMinNum = 2     minimum number of individuals to save genotype
  2120.  
  2121.      A genotype will not be given a permanent name and saved to disk in
  2122. a .gen file unless it has a population of SavMinNum or more adult individuals.
  2123.  
  2124. SavThrMem = .04  threshold memory occupancy to save genotype
  2125. SavThrPop = .04  threshold population proportion to save genotype
  2126.  
  2127.      These two variables affect the rate at which genomes are assigned
  2128. permanent names and saved to disk.  In a soup of 60,000 instructions
  2129. (SoupSize = 60000),   thresholds of .05 will save about one genome per two
  2130. million instructions, thresholds of .04 will save about one genome per
  2131. million instructions, thresholds of .03 will save about 1.2 genomes per
  2132. million instructions, thresholds of .02 will save about three genome per
  2133. million instructions.  On DOS systems, care should be taken to avoid
  2134. saving too many genomes as they will clog the memory and bring the system
  2135. down (See KNOWN BUGS below).
  2136.  
  2137. SavThrMem = .04  threshold memory occupancy to save genotype
  2138.  
  2139.      If a particular genotype fills SavThrMem of the total space available
  2140. in the soup, it will be assigned a permanent unique name, and saved to disk.
  2141. Note that an adjustment is made because only adult cells are counted, and
  2142. embryos generally fill half the soup.  Therefore adult cells of a particular
  2143. genotype need only occupy SavThrMem * 0.5 of the space to be saved.
  2144.  
  2145. SavThrPop = .04  threshold population proportion to save genotype
  2146.  
  2147.      If a particular genotype amounts to SavThrPop of the total population
  2148. of (adult) cells in the soup, it will be assigned a permanent unique name,
  2149. and saved to disk.
  2150.  
  2151. WatchExe = 0     mark executed instructions in genome in genebank
  2152. WatchMov = 0     set mov bits in genome in genebank
  2153. WatchTem = 0     set template bits in genome in genebank
  2154.  
  2155.      WARNING: setting any of these three watch parameters will engage cpu
  2156. intensive observational software that will substantially slow down any
  2157. simulation.  Engage these tools only if you plan to use the data that
  2158. they generate.
  2159.  
  2160. WatchExe = 0     mark executed instructions in genome in genebank
  2161.  
  2162.      If the genebank is on, setting this parameter to a non-zero value
  2163. will turn on a watch of which instructions are being executed in each
  2164. permanent genotype (this helps to distinguish junk code from code that is
  2165. executed), and also, who is executing whose instructions.  There is a bit
  2166. field in the GList structure (bit definitions are defined in the tierra.h
  2167. module) that keeps track of whether a creature executes its own instructions,
  2168. those of another creature, if another creature executes this creatures
  2169. instructions, etc:
  2170.  
  2171.     bit  2  EXs = executes own instructions (self)
  2172.     bit  3  EXd = executes daughter's instructions
  2173.     bit  4  EXo = executes other cell's instructions
  2174.     bit  5  EXf = executes instructions in free memory
  2175.     bit  6  EXh = own instructions are executed by other creature (host)
  2176.  
  2177. WatchMov = 0     set mov bits in genome in genebank
  2178.  
  2179.      If the genebank is on, setting this parameter to a non-zero value
  2180. will turn on a watch of who moves whose instructions and where.  This
  2181. information is recorded in the bit field in GList structure:
  2182.  
  2183.     bit 17  MFs = moves instruction from self
  2184.     bit 18  MFd = moves instruction from daughter
  2185.     bit 19  MFo = moves instruction from other cell
  2186.     bit 20  MFf = moves instruction from free memory
  2187.     bit 21  MFh = own instructions are moved by other creature (host)
  2188.     bit 22  MTs = moves instruction to self
  2189.     bit 23  MTd = moves instruction to daughter
  2190.     bit 24  MTo = moves instruction to other cell
  2191.     bit 25  MTf = moves instruction to free memory
  2192.     bit 26  MTh = is written on by another creature (host)
  2193.     bit 27  MBs = executing other creature's code, moves inst from self
  2194.     bit 28  MBd = executing other creature's code, moves inst from daughter
  2195.     bit 29  MBo = executing other creature's code, moves inst from other cell
  2196.     bit 30  MBf = executing other creature's code, moves inst from free memory
  2197.     bit 31  MBh = other creature uses another cpu to move your instructions
  2198.  
  2199. WatchTem = 0     set template bits in genome in genebank
  2200.  
  2201.      If the genebank is on, setting this parameter to a non-zero value
  2202. will turn on a watch of whose templates are matched by whom.  This
  2203. information is recorded in the bit field in the GList structure:
  2204.  
  2205.     bit  7  TCs = matches template complement of self
  2206.     bit  8  TCd = matches template complement of daughter
  2207.     bit  9  TCo = matches template complement of other
  2208.     bit 10  TCf = matches template complement of free memory
  2209.     bit 11  TCh = own template complement is matched by other creature (host)
  2210.     bit 12  TPs = uses template pattern of self
  2211.     bit 13  TPd = uses template pattern of daughter
  2212.     bit 14  TPo = uses template pattern of other
  2213.     bit 15  TPf = uses template pattern of free memory
  2214.     bit 16  TPh = own template pattern is used by other creature (host)
  2215.  
  2216. # environmental variables:
  2217.  
  2218.      This is a comment indicating the beginning of the environmental
  2219. parameters.  These parameters affect the course of evolution and
  2220. ecology of the run.
  2221.  
  2222. alive = 500            how many millions of instruction will we run
  2223.  
  2224.      This tells the simulator how long to run, in millions of instructions.
  2225.  
  2226. DistFreq = .3       frequency of disturbance, factor of recovery time
  2227.  
  2228.      The frequency of disturbance, as a factor of recovery time.  This and
  2229. the next option control the pattern of disturbance.  If you do not want the
  2230. system to be disturbed, set DistFreq to a negative value.  If DistFreq has
  2231. a non-negative value, when the soup fills up the reaper will be invoked to
  2232. kill cells until it has freed a proportion DistProp of the soup.  The system
  2233. will then keep track of the time it takes for the creatures to recover from
  2234. the disturbance by filling the soup again.  Let's call this recovery time:
  2235. rtime.  The next disturbance will occur: (rtime X DistFreq) after recovery
  2236. is complete.  Therefore, if DistFreq = 0, each disturbance will occur
  2237. immediately after recovery is complete.  If DistFreq = 1, the time between
  2238. disturbances will be twice the recovery time, that is, the soup will remain
  2239. full for a period equal to the recovery time, before another disturbance hits.
  2240.  
  2241. DistProp = .2       proportion of population affected by distrubance
  2242.  
  2243.      The proportion of the soup that is freed of cells by each disturbance.
  2244. The disturbance occurs by invoking the reaper to kill cells until the total
  2245. amount of free memory is greater than or equal to: (DistProp X SoupSize).
  2246. Note that cells are not killed at random, they are killed off the top of the
  2247. reaper queue, except as modified by the ReapRndProp variable.
  2248.  
  2249. DivSameGen = 0 must produce offspring of same genotype, to stop evolution
  2250.  
  2251.      This causes attempts at cell division to abort if the offspring is of
  2252. a genotype different from the parent.  This can be used when the mutation
  2253. rates are set to zero, to prevent sex from causing evolution.
  2254.  
  2255. DivSameSiz = 0 cells must produce offspring of same size, to stop size change
  2256.  
  2257.      Like DivSameGen, but cell division aborts only if the offspring is of
  2258. a different size than the parent.  Changes in genotype are not prevented,
  2259. only changes in size are prevented.
  2260.  
  2261. DropDead = 5 stop system if no reproduction in the last x million instructions
  2262.  
  2263.      Sometimes the soup dies, such as when mutation rates are too high.
  2264. This parameter watches the time elapsed since the last cell division, and
  2265. brings the system down if it is greater than DropDead million instructions.
  2266.  
  2267. GenPerBkgMut = 16 mutation rate control by generations ("cosmic ray")
  2268.  
  2269.      Control of the background mutation rate ("cosmic ray").  The value 16
  2270. indicates that in each generation, roughly one in sixteen cells will be hit
  2271. by a mutation.  These mutations occur completely at random, and also affect
  2272. free space where there are no cells.  If the value of GenPerBkgMut were 0.5,
  2273. it would mean that in each generation, each cell would be hit by roughly
  2274. two mutations.
  2275.  
  2276. GenPerFlaw = 64       flaw control by generations
  2277.  
  2278.      Control of the flaw rate.  The value 64 means that in each generation,
  2279. roughly one in sixty-four individuals will experience a flaw.  Flaws cause
  2280. instructions to produce results that are in error by plus or minus one,
  2281. in some sense.  If the value of GenPerFlaw were 0.5, it would mean that in
  2282. each generation, each cell would be hit by roughly two flaws.  This parameter
  2283. has a profound effect on the rate at which creatures shrink in size under
  2284. selection for small size.
  2285.  
  2286. GenPerMovMut = 8    mutation rate control by generations (copy mutation)
  2287.  
  2288.      Control of the move mutation rate (copy mutation).  The value 8
  2289. indicates that in each generation, roughly one in eight cells will be hit
  2290. by a mutation.  These mutations only affect copies of instructions made
  2291. during replication (by the double indirect mov instruction).  When an
  2292. instruction is affected by a mutation, one of its five bits is selected
  2293. at random and flipped.  If the value of GenPerMovMut were 0.5, it would
  2294. mean that in each generation, each cell would be hit by roughly two
  2295. move mutations.
  2296.  
  2297. IMapFile = opcode.map map of opcodes to instructions, file in GenebankPath
  2298.  
  2299.     Names the file containing the Instruction Set Map.  The simulator will
  2300. look for this file in the GenebankPath.  Please remember to only use
  2301. genebank files created with compatible map files.  If you specify the
  2302. name of the map file as: IMapFile = -.map
  2303. then the file will not be read, and the default opcode mapping will be used.
  2304.  
  2305. MateProb = 0.2  probability of mating at each mal
  2306. MateSearchL = 5 multiple of avgsize to search 0 = no limit
  2307. MateSizeEp = 2 size epsilon for potential mate
  2308. MateXoverProp = 1.0 proportion of gene to secect for crossover point
  2309.  
  2310. Haploid Sex (aka crosover):
  2311.  
  2312. Haploid sex has been implemented in mimicry of Walter Tackett's
  2313. (tackett@ipld01.hac.com) implementation
  2314. in his private version of Tierra.  This form of sex is more in the spirit
  2315. of the genetic algorithm that Tierra, in that the creatures don't have any
  2316. choice in the matter, they are forced to have sex at god's whim.  However,
  2317. it does have the virtue of creating something like a biological species, in
  2318. that individuals close in size exchange genes creating an evolving gene pool.
  2319.  
  2320. The Tierran reproduction mechanism of repeatedly copying data from an offset
  2321. in the mother cell to an offset (presumably) in a daughter cell, can be
  2322. modified to easily allow ``crossover'' of genetic data.  Crossover seems to
  2323. provide a means of increasing the rate of evolution.  It can be thought of as
  2324. a higher mutation rate which can ``favor good genes''.  This affect will be
  2325. made clear by euclidating how haploid crossover ``sex'' is done in the
  2326. Tierran model.
  2327.  
  2328. At the time a creature allocates a block of memory for a daughter (mal),
  2329. Tierra decides if this creature will mate, using the soup_in variable
  2330. MateProb (0.0 = no mating at all, 100.0 = creatures will try to mate 100% of
  2331. the time). If the creature is not selected for mating, Tierra continues
  2332. as normal until the next time this creature executes a memory allocate.
  2333. If this creature does mate, a point in the creatures genome, selected
  2334. randomly from the proportion MateXoverProp of the genome size, is chosen 
  2335. as the ``cross over'' point.  Also whether we use the first part, or the last 
  2336. part of the genome is also chosen (chances are 1 in 2 for each "half").  
  2337. No further actions are taken until the creature begins moving data 
  2338. (presumably from herself, to the daughter cell).
  2339.  
  2340. At the time that the creature first copies an instruction of its genome to
  2341. a new location (presumably in the daughter cell) using the moviab instruction,
  2342. a mate is chosen.  The mate is chosen at this point because the chances 
  2343. of the mate dying before the cross over is complete are smaller now than
  2344. at the time of the memory allocation.  A potential mate must be similar
  2345. in size to the creature trying to mate (creature's size +/- MateSizeEp),
  2346. and may not be of the exact same genotype (eg. 0080aaa can't mate
  2347. with another 0080aaa, there would be no point in the operation).  The
  2348. search radius from the creature to the mate is determinied by MateSearchL.
  2349. MateSearchL is multiplied by the Average Creature Size to determine the
  2350. number of bytes to search.  NOTE - in release 3.13, only FORWARD ( towards
  2351. higher addresses ) in done.  This will become bidirectional in future 
  2352. releases.  Even if a creature is selected for mating a the time of execution
  2353. of the mal instruction, it may not actually mate, because it may not be
  2354. able to find a mate of a different genotype, in the correct size range, and
  2355. within the search radius.
  2356.  
  2357. If we have chosen to contribute our first section to the daughter, our mate
  2358. will contribute the second section.  In that case, the copying of the genome
  2359. will proceed normally until we reach the crossover point.  After that, each
  2360. time we execute the moviab instruction, we will copy an instruction from
  2361. the genome of our mate rather than from our genome.  The creature is
  2362. ``unaware'' of this process.  For the sake of clarity an example is given:
  2363.  
  2364. Example A - Mate contributes second half :
  2365.  
  2366.   creature ( 10 bytes long ) & mate ( 9 bytes long )
  2367.   [ step 0 ] mal - selects Xover point of 5, second half
  2368.   [ step 1 ] move bytes at offset 0-4 from self
  2369.   [ step 2 ] move byte at offset 5-9 from mate
  2370.   [ step 3 ] move byte after last byte of mate ( 10th byte )
  2371.  
  2372. Example B - Mate contributes first half :
  2373.  
  2374.   creature ( 10 bytes long ) & mate ( 11 bytes long )
  2375.   [ step 0 ] mal - selects Xover point of 5, first half
  2376.   [ step 1 ] move bytes at offset 0-4 from mate
  2377.   [ step 2 ] move byte at offset 5-10 from self 
  2378.  
  2379. MaxMalMult = 3        multiple of cell size allowed for mal()
  2380.  
  2381.      When a cell attempts to allocate a second block of memory (presumably
  2382. to copy its genome into), this parameter is checked.  If the amount of memory
  2383. requested is greater than MaxMalMult times the size of the mother cell, the
  2384. request will fail.  This prevents mutants from requesting the entire soup,
  2385. which would invoke the reaper to cause a massive kill off.
  2386.  
  2387. MemModeFree = 0  read, write, execute protection for free memory
  2388.  
  2389.      When memory is free, not owned by any creature, it will have this
  2390. protection.  0 means that anybody can read, write, or execute the memory.
  2391.  
  2392. MemModeProt = 2 rwx protect mem: 1 bit = execute, 2 bit = write, 4 bit = read
  2393.  
  2394.      When memory is owned by a creature, it will have this protection.
  2395. 2 means that write privelage is protected, so only the owner can write on
  2396. the memory.  The owner always has read write, execute privelages on owned
  2397. memory.  However, other creatures must obey the MemModeProt protection,
  2398. they are excluded from the activities whose bits are set.  Be aware that
  2399. in the current version of the simulator, only write protection is implemented.
  2400.  
  2401. MinCellSize = 8       minimum size for cells
  2402.  
  2403.      When a cell attempts to divide, this parameter is checked.  If the
  2404. daughter cell would be smaller than MinCellSize instructions, divide will
  2405. fail.  The reason this is needed is that with no lower limit, there is a
  2406. tendency for some mutants to spawn large numbers of very small cells.
  2407.  
  2408. MinTemplSize = 1       minimum size for templates
  2409.  
  2410.      When an instruction (like jump) attempts to use a template, this
  2411. parameter is checked.  If the actual template is smaller than MinTemplSize
  2412. instructions, the instruction will fail.  This is a matter of taste.
  2413.  
  2414. MovPropThrDiv = .7       minimum proportion of daughter cell filled by mov
  2415.  
  2416.      When a cell attempts to divide, this parameter is checked.  If the
  2417. mother cell has moved less than MovPropThrDiv times the mother cell size, of
  2418. instructions into the daughter cell, cell division will abort.  A value of .7
  2419. means that the mother must at least fill the daughter 70% with instructions
  2420. (though all these instructions could have been moved to the same spot in
  2421. the daughter cell).  The reason this parameter exists is that without it,
  2422. mutants will attempt to spew out large numbers of empty cells.
  2423.  
  2424. new_soup = 1          1 = this a new soup, 0 = restarting an old run
  2425.  
  2426.      This value is checked on startup, to determine if this is a new soup,
  2427. or if this is restarting an old run where it left off.  When the system
  2428. comes down, all soup_in parameter (and many other global variables) are
  2429. saved in a file called soup_out.  The value of new_soup is set to 0 in
  2430. soup_out.  In order to restart an old run, just use soup_out as the input
  2431. file rather than soup_in.  This is done by using soup_out as a command line
  2432. parameter at startup: tierra soup_out
  2433.  
  2434. NumCells = 3      number of creatures and gaps used to inoculate new soup
  2435.  
  2436.      This parameter is checked at startup, and the system will look for a
  2437. list of NumCells creatures at the end of the soup_in file.  The value 3
  2438. indicates that the soup will initially be innoculated by three cells.
  2439. However, NumCells also counts gaps that are placed between cells (without
  2440. gaps, all cells are packed together at the bottom of the soup at startup).
  2441. The gap control feature does not work at present, so don't use it.  Notice
  2442. that after the list of parameters in the soup_in file, there is a blank
  2443. line, followed by a list of genotypes.  The system will read the first 
  2444. NumCells genotypes from the list, and place them in the soup in the same
  2445. order that they occur in the list.
  2446.  
  2447. PhotonPow = 1.5         power for photon match slice size
  2448.  
  2449.      If SliceStyle (see below) is set to the value 1, then the allocation
  2450. of CPU cycles to creatures is based on a photon - chlorophyll metaphor.
  2451. Imagine that photons are raining down on the soup at random.  The cell hit
  2452. by the photon gets a time slice that is proportional to the goodness of fit
  2453. between the pattern of instructions that are hit, and an arbitrary pattern
  2454. (defined by PhotonWord, see below).
  2455.  
  2456.      The template of instructions defined by PhotonWord is laid over the
  2457. sequence of instructions at the site hit by the photon.  The number of
  2458. instructions that match between the two is used to determine the slice
  2459. size.  However, the number of matching instructions is raised to the power
  2460. PhotonPow, to calculate the slice size.
  2461.  
  2462. PhotonWidth = 8   amount by which photons slide to find best fit
  2463.  
  2464.      When a photon hits the soup, it slides a distance PhotonWidth, counting
  2465. the number of matching characters at each position, and the slice size will
  2466. be equal to the number of characters in the best match (raised to the power
  2467. PhotonPow, see above).  If PhotonWidth equals 8, the center of the template
  2468. will start 4 instructions to the left of the site hit by the photon, and
  2469. slide to 4 instructions to the right of the site hit.
  2470.  
  2471. PhotonWord = chlorophill  word used to define photon
  2472.  
  2473.      This string determines the arbitrary pattern that absorbs the photon.
  2474. It uses a base 32 numbering system: the digits 0-9 followed by the characters
  2475. a-v.  The characters w, x, y and z are not allowed (that is why chlorophyll
  2476. is misspelled).  The string may be any length up to 79 characters.
  2477.  
  2478. ReapRndProp = .0 top prop of reaper que to reap from
  2479.  
  2480.      This parameter determines the degree to which mortality is random.
  2481. If ReapRndProp is set to zero, the reaper always kills the creature at the
  2482. top of the reaper queue.  If ReapRndProp is set to one, the reaper kills
  2483. at random.  If ReapRndProp is set to 0.3, the reaper will kill a cell selected
  2484. at random from the top 30% of the reaper queue.
  2485.  
  2486. SearchLimit = 5
  2487.  
  2488.      This parameter controls how far instructions may search to match
  2489. templates.  The value five means that search is limited to five times the
  2490. average adult cell size.  The actual distance is updated every million
  2491. instructions.
  2492.  
  2493. seed = 0 seed for random number generator, 0 uses time to set seed
  2494.  
  2495.      The seed for the random number generator.  If you use the value zero,
  2496. the system clock combined with the random number generator is used to set the
  2497. seed.  If you use any other value, it will be the seed.  The starting seed
  2498. (even when provided by the clock) will be written to standard output, the
  2499. tierra.log file, and also saved in the soup_out file when the simulator comes
  2500. down.  By using the original seed and all the same initial parameter settings
  2501. in soup_in, a run may be repeated exactly.
  2502.  
  2503. SizDepSlice = 0  set slice size by size of creature
  2504.  
  2505.      This determines a major slicer option.  If this parameter is set to
  2506. zero, the slice size will either be a constant set by SliceSize (see below)
  2507. or a uniform random variate, or a mix of the two.  The mix is determined by
  2508. the relative values of SlicFixFrac and SlicRanFrac (see below).  The actual
  2509. slice size will be:
  2510.  
  2511. (SlicFixFrac * SliceSize) + (tlrand() % (I32s) ((SlicRanFrac * SliceSize) + 1))
  2512.  
  2513.      If SizDepSlice is set to a non-zero value, the slice size will be
  2514. proportional to the size of the genome.  In this case, the base slice size
  2515. will be the genome size raised to the power SlicePow (see below).  To clarify
  2516. let slic_siz = genome_size ^ SlicePow, the actual slice size will be:
  2517.  
  2518. (SlicFixFrac * slic_siz) + (tlrand() % (I32s) ((SlicRanFrac * slic_siz) + 1))
  2519.  
  2520. SlicePow = 1    set power for slice size, use when SizDepSlice = 1
  2521.  
  2522.      This parameter is only used when SizDepSlice = 1.  In this case, the
  2523. genome size is raised to the power SlicePow to determine the slice size
  2524. (see algorithm under SizDepSlice above).  If SlicePow = 1, the run will be
  2525. size neutral, selection will not be biased toward either large or small
  2526. creatures (the probability of an instruction being executed is not dependent
  2527. on the size of the genome it is located in).  If SlicePow > 1, selection will
  2528. favor larger genomes.  If SlicePow < 1, selection will favor small genomes.
  2529.  
  2530. SliceSize = 25    slice size when SizDepSlice = 0
  2531.  
  2532.      This parameter determines the base slice size when SizDepSlice = 0.
  2533. The actual slice size in this case depends on the values of SlicFixFrac
  2534. and SlicRanFrac (see below).  The way the slice size is actually calculated
  2535. is explained under SizDepSlice above.
  2536.  
  2537. SliceStyle = 2   choose style of determining slice size
  2538.  
  2539.      The slicer is a pointer to function, and the function actually used
  2540. is determined by this parameter.  At present there are three choices (0-2).
  2541. The pointer to function is assigned in the setup.c module, and the slicer
  2542. functions themselves are contained in the slicers.c module.
  2543. 0 = SlicerQueue() - slice sizes without a random component
  2544. 1 = SlicerPhoton() - slice size based on photon interception metaphor
  2545. 2 = RanSlicerQueue() - slice size with a fixed and a random component
  2546.  
  2547. SlicFixFrac = 0   fixed fraction of slice size
  2548.  
  2549.      When SliceStyle = 2, the slice size has a fixed component and a random
  2550. component.  This parameter determines the fixed component as a multiple
  2551. of SliceSize, or genome_size ^ SlicePow.
  2552.  
  2553. SlicRanFrac = 2   random fraction of slice size
  2554.  
  2555.      When SliceStyle = 2, the slice size has a fixed component and a random
  2556. component.  This parameter determines the random component as a multiple
  2557. of SliceSize, or genome_size ^ SlicePow.
  2558.  
  2559. SoupSize = 50000 size of soup in instructions
  2560.  
  2561.      This variable sets the size of the soup, measured in instructions.
  2562.  
  2563. 0080aaa
  2564. 0045aaa
  2565. 0080aaa
  2566.  
  2567.      This is the list of cells that will be loaded into the soup when
  2568. the simulator starts up.  This example indicates that three cells will
  2569. be loaded at startup, the ancestor 0080aaa alternating with the parasite
  2570. 0045aaa.  These cells will be loaded in the bottom of the soup, with no
  2571. space between them.
  2572.  
  2573. 8)  THE INSTRUCTION SET(S)
  2574.  
  2575.      At present, only a single instruction set has been implemented, it is
  2576. INST == 1.  The associations of opcodes, mnemonics, parsing functions and
  2577. executables that define this instruction set are determined by the following
  2578. array of structures defined in the soup_in.h file:
  2579.  
  2580. typedef struct { /* structure for instruction set definitions */
  2581.     I8s op;                         /* op code */
  2582.     I8s mn[9];                      /* assembler mnemonic */
  2583.     void (*execute) P_((Cell  *));  /* pointer to execute function */
  2584.     void (*parse) P_((Cell  *));    /* pointer to parse function */
  2585. } InstDef; /* this structure is defined in tierra.h */
  2586.  
  2587. InstDef id[INSTNUM] = {
  2588.     {0x00, "nop_0", nop, pnop},
  2589.     {0x01, "nop_1", nop, pnop},
  2590.     {0x02, "or1", or1, por1},
  2591.     {0x03, "shl", shl, pshl},
  2592.     {0x04, "zero", movdd, pzero},
  2593.     {0x05, "if_cz", if_cz, pif_cz},
  2594.     {0x06, "sub_ab", math, psub_ab},
  2595.     {0x07, "sub_ac", math, psub_ac},
  2596.     {0x08, "inc_a", math, pinc_a},
  2597.     {0x09, "inc_b", math, pinc_b},
  2598.     {0x0a, "dec_c", math, pdec_c},
  2599.     {0x0b, "inc_c", math, pinc_c},
  2600.     {0x0c, "pushax", push, ppushax},
  2601.     {0x0d, "pushbx", push, ppushbx},
  2602.     {0x0e, "pushcx", push, ppushcx},
  2603.     {0x0f, "pushdx", push, ppushdx},
  2604.     {0x10, "pop_ax", pop, ppop_ax},
  2605.     {0x11, "pop_bx", pop, ppop_bx},
  2606.     {0x12, "pop_cx", pop, ppop_cx},
  2607.     {0x13, "pop_dx", pop, ppop_dx},
  2608.     {0x14, "jmp", adr, ptjmp},
  2609.     {0x15, "jmpb", adr, ptjmpb},
  2610.     {0x16, "call", tcall, ptcall},
  2611.     {0x17, "ret", pop, pret},
  2612.     {0x18, "mov_cd", movdd, pmov_dc},
  2613.     {0x19, "mov_ab", movdd, pmov_ba},
  2614.     {0x1a, "moviab", movii, pmoviab},
  2615.     {0x1b, "adr", adr, padr},
  2616.     {0x1c, "adrb", adr, padrb},
  2617.     {0x1d, "adrf", adr, padrf},
  2618.     {0x1e, "mal", malchm, pmal},
  2619.     {0x1f, "divide", divide, pdivide}
  2620.  
  2621.      The parsing functions are contained in the parse.c file, and the
  2622. executables are contained in the instruct.c file.  This instruction
  2623. set operates in the following cpu structure, in which NUM_REGS = 4 and
  2624. STACK_SIZE = 10:
  2625.  
  2626. typedef struct {        /* structure for registers of virtual cpu */
  2627.     Reg re[NUM_REGS];   /* array of registers */
  2628.     Reg sp;             /* stack pointer */
  2629.     Reg st[STACK_SIZE]; /* stack */
  2630.     Reg ip;             /* instruction pointer */
  2631.     I8s fl;             /* flag */
  2632.     I8s tr;             /* which track currently being executed */
  2633. } Cpu;
  2634.  
  2635.      This cpu and instruction set are based on the Intel 80x86 processor,
  2636. therefore the four registers in the re[4] array are considered to have
  2637. the following names: re[0] = ax, re[1] = bx, re[2] = cx, re[3] = dx.  The
  2638. registers will be referred to by these names in the following discussion.
  2639.  
  2640.      In general, the ax and bx registers are used to hold addresses, which
  2641. refer to locations in the soup.  Values contained in the ax and bx registers
  2642. are maintained as positive integers, modulus SoupSize.  The cx and dx
  2643. registers are generally used to hold numbers, which may be either positive or
  2644. negative.  Values contained in the cx and dx registers are forced to remain
  2645. in the range -SoupSize to SoupSize.  Any operation which causes the values
  2646. in the cx or dx registers to stray out of this range will cause the
  2647. instruction to fail and a flag to be set (in this case, the value in the
  2648. cx or dx register retains the value it contained before the instruction
  2649. executed).
  2650.  
  2651.      Many of the instructions will fail under certain conditions, which are
  2652. specified for each instruction in the following discussion.  Any time an
  2653. instruction fails, it does nothing, other than to increment the instruction
  2654. pointer, decrement the instruction bank, and set the flag register (to the
  2655. value 1).  Any time and instruction does not fail, it clears the flag register
  2656. (to the value 0).  All instructions clear the flag on success, and set the
  2657. flag on failure.  Every instruction decrements the instruction bank by one,
  2658. regardless of success or failure.
  2659.  
  2660.      What follows is a list of the thirty-two instructions of INST == 1,
  2661. along with details of their behavior:
  2662.  
  2663. {0x00, "nop_0", nop, pnop}, /* do nothing */
  2664. {0x01, "nop_1", nop, pnop},
  2665.  
  2666.      These two instructions are no-ops, they do nothing, other than to
  2667. increment the instruction pointer one place.  There are no conditions under
  2668. which these instructions fail.
  2669.  
  2670. {0x02, "or1", or1, por1}, /* flip low order bit of cx */
  2671.  
  2672.      This instruction flips the low order bit of the cx register.  The only
  2673. condition under which it fails is if this operation causes the value in
  2674. the register to stray out of the range -SoupSize to SoupSize.  In this
  2675. case cx retains its original value and the flag is set.  In every case, the
  2676. instruction pointer is incremented by one.
  2677.  
  2678. {0x03, "shl", shl, pshl}, /* shift left all register of cx */
  2679.  
  2680.      This instruction shifts all bits of the cx register one position to
  2681. the left, replacing the rightmost (low order) bit with a zero (this is a
  2682. binary multiply by two).  The only condition under which it fails is if this
  2683. operation causes the value in the register to stray out of the range -SoupSize
  2684. to SoupSize.  In this case cx retains its original value and the flag is set.
  2685. In every case, the instruction pointer is incremented by one.
  2686.  
  2687. {0x04, "zero", movdd, pzero}, /* cx = 0 */
  2688.  
  2689.      This instruction sets the cx register to zero.  It also increments the
  2690. instruction pointer one place.  There are no conditions under which this
  2691. instruction fails.
  2692.  
  2693. {0x05, "if_cz", if_cz, pif_cz}, /* execute next instruction only if cx == 0 */
  2694.  
  2695.      This instruction will increment the instruction pointer by one if the
  2696. value in the cx register is zero, or by two if the cx register contains
  2697. any other value (this means that the instruction following this one will be
  2698. executed only if the value in the cx register is zero).  There are no
  2699. conditions under which this instruction fails.
  2700.  
  2701. {0x06, "sub_ab", math, psub_ab}, /* cx = ax - bx */
  2702.  
  2703.      This instruction subtracts the value in the bx register from the value
  2704. in the cx register, placing the result in the cx register.  This instruction
  2705. can fail only if the resultant value in the cx register would be outside of
  2706. the range -SoupSize to SoupSize, in which case the original value in the cx
  2707. register remains, and a flag is set.  In any case, the instruction pointer
  2708. is incremented by one.
  2709.  
  2710. {0x07, "sub_ac", math, psub_ac}, /* ax = ax - cx */
  2711.  
  2712.      This instruction subtracts the value in the cx register from the value
  2713. in the ax register, placing the result in the ax register.  It increments the
  2714. instruction pointer by one.  There are no conditions under which this
  2715. instruction fails.
  2716.  
  2717. {0x08, "inc_a", math, pinc_a}, /* ax++ */
  2718.  
  2719.      This instruction increments (adds one to) the value in the ax register,
  2720. placing the result in the ax register.  It increments the instruction pointer
  2721. by one.  There are no conditions under which this instruction fails.
  2722.  
  2723. {0x09, "inc_b", math, pinc_b}, /* bx++ */
  2724.  
  2725.      This instruction increments (adds one to) the value in the bx register,
  2726. placing the result in the bx register.  It increments the instruction pointer
  2727. by one.  There are no conditions under which this instruction fails.
  2728.  
  2729. {0x0a, "dec_c", math, pdec_c}, /* cx-- */
  2730.  
  2731.      This instruction decrements (subtracts one from) the value in the cx
  2732. register, placing the result in the cx register.  It increments the
  2733. instruction pointer by one.  This instruction can fail only if the resultant
  2734. value in the cx register would be outside of the range -SoupSize to SoupSize,
  2735. in which case the original value in the cx register remains, and a flag is set.
  2736.  
  2737. {0x0b, "inc_c", math, pinc_c}, /* cx++ */
  2738.  
  2739.      This instruction increments (adds one to) the value in the cx register,
  2740. placing the result in the cx register.  It increments the instruction pointer
  2741. by one.  This instruction can fail only if the resultant value in the cx
  2742. register would be outside of the range -SoupSize to SoupSize, in which case
  2743. the original value in the cx register remains, and a flag is set.
  2744.  
  2745. {0x0c, "pushax", push, ppushax}, /* push ax onto stack */
  2746.  
  2747.      This instruction causes the value in the ax register to be pushed onto
  2748. the stack, and the stack pointer to be incremented (modulus STACK_SIZE).
  2749. It increments the instruction pointer by one.  There are no conditions under
  2750. which this instruction fails.
  2751.  
  2752. {0x0d, "pushbx", push, ppushbx}, /* push bx onto stack */
  2753.  
  2754.      This instruction causes the value in the bx register to be pushed onto
  2755. the stack, and the stack pointer to be incremented (modulus STACK_SIZE).
  2756. It increments the instruction pointer by one.  There are no conditions under
  2757. which this instruction fails.
  2758.  
  2759. {0x0e, "pushcx", push, ppushcx}, /* push cx onto stack */
  2760.  
  2761.      This instruction causes the value in the cx register to be pushed onto
  2762. the stack, and the stack pointer to be incremented (modulus STACK_SIZE).
  2763. It increments the instruction pointer by one.  There are no conditions under
  2764. which this instruction fails.
  2765.  
  2766. {0x0f, "pushdx", push, ppushdx}, /* push dx onto stack */
  2767.  
  2768.      This instruction causes the value in the dx register to be pushed onto
  2769. the stack, and the stack pointer to be incremented (modulus STACK_SIZE).
  2770. It increments the instruction pointer by one.  There are no conditions under
  2771. which this instruction fails.
  2772.  
  2773. {0x10, "pop_ax", pop, ppop_ax}, /* pop ax off of stack */
  2774.  
  2775.      This instruction causes the value at the top of the stack to be popped
  2776. into the ax register and the stack pointer to be decremented (modulus
  2777. STACK_SIZE).  It increments the instruction pointer by one.  There are no
  2778. conditions under which this instruction fails.
  2779.  
  2780. {0x11, "pop_bx", pop, ppop_bx}, /* pop bx off of stack */
  2781.  
  2782.      This instruction causes the value at the top of the stack to be popped
  2783. into the bx register and the stack pointer to be decremented (modulus
  2784. STACK_SIZE).  It increments the instruction pointer by one.  There are no
  2785. conditions under which this instruction fails.
  2786.  
  2787. {0x12, "pop_cx", pop, ppop_cx}, /* pop cx off of stack */
  2788.  
  2789.      This instruction causes the value at the top of the stack to be popped
  2790. into the cx register and the stack pointer to be decremented (modulus
  2791. STACK_SIZE).  It increments the instruction pointer by one.  This instruction
  2792. can fail only if the resultant value in the cx register would be outside of
  2793. the range -SoupSize to SoupSize, in which case the original value in the cx
  2794. register remains, and a flag is set.
  2795.  
  2796. {0x13, "pop_dx", pop, ppop_dx}, /* pop dx off of stack */
  2797.  
  2798.      This instruction causes the value at the top of the stack to be popped
  2799. into the dx register and the stack pointer to be decremented (modulus
  2800. STACK_SIZE).  It increments the instruction pointer by one.  This instruction
  2801. can fail only if the resultant value in the dx register would be outside of
  2802. the range -SoupSize to SoupSize, in which case the original value in the dx
  2803. register remains, and a flag is set.
  2804.  
  2805. {0x14, "jmp", adr, ptjmp}, /* outward template jump */
  2806.  
  2807.      This instruction causes the instruction pointer to be redirected to the
  2808. instruction following the nearest occurrence of the template complementary
  2809. to the template that follows the jmp instruction.  The template is defined
  2810. as the group of consecutive nops (nop_0 or nop_1) that immediately follow the
  2811. jmp instruction.  The size of the template is just the number of consecutive
  2812. nops that follow the jmp instruction.  The size of the template is placed in
  2813. the dx register.
  2814.  
  2815.      This instruction is a bi-directional jump, which means that it will
  2816. search both forward and backward in memory for the complementary template.
  2817. Let a equal the address of the first instruction of the template, and let
  2818. s equal the size of the template.  The forward search starts at the address
  2819. a + s + 1, and the backward search starts at the address a - s - 1.  The
  2820. search looks in the forward direction first, then alternately looks ahead
  2821. or back one additional step until the complementary template is found, or
  2822. the search limit (Search_limit) is reached.  The template searches wrap around
  2823. the ends of the soup.
  2824.  
  2825.      The instruction will fail if the size of the template following the jmp
  2826. instruction is less than MinTemplSize, or greater than SoupSize, or if a
  2827. complementary template is not found within the search radius, Search_limit.
  2828. On failure, the instruction pointer is moved past the template used by the
  2829. jmp instruction: ce->c.ip = ce->c.ip + s + 1.
  2830.  
  2831. {0x15, "jmpb", adr, ptjmpb}, /* backward template jump */
  2832.  
  2833.      This instruction causes the instruction pointer to be redirected to the
  2834. instruction following the nearest occurrence (backwards in the soup) of the
  2835. template complementary to the template that follows the jmp instruction.  The
  2836. template is defined as the group of consecutive nops (nop_0 or nop_1) that
  2837. immediately follow the jmp instruction.  The size of the template is just the
  2838. number of consecutive nops that follow the jmp instruction.  The size of the
  2839. template is placed in the dx register.
  2840.  
  2841.      This instruction is a uni-directional jump, which means that it will
  2842. search in only one direction (in this case, only backward) in memory for the
  2843. complementary template.  Let a equal the address of the first instruction of
  2844. the template, and let s equal the size of the template.  The backward search
  2845. starts at the address a - s - 1.  The search looks in successive steps
  2846. backwards until the complementary template is found, or the search limit
  2847. (Search_limit) is reached.  The template searches wrap around the ends of the
  2848. soup.
  2849.  
  2850.      The instruction will fail if the size of the template following the jmp
  2851. instruction is less than MinTemplSize, or greater than SoupSize, or if a
  2852. complementary template is not found within the search radius, Search_limit.
  2853. On failure, the instruction pointer is moved past the template used by the
  2854. jmp instruction: ce->c.ip = ce->c.ip + s + 1.
  2855.  
  2856. {0x16, "call", tcall, ptcall}, /* push ip to stack, outward template jump */
  2857.  
  2858.      This instruction behaves identically to the jmp instruction, with the
  2859. one difference that the address following the tempate following the call
  2860. instruction is also pushed onto the stack (this is essentially the address
  2861. of the instruction pointer plus one meaningful instruction).  On failure, the
  2862. instruction pointer is moved past the template used by the jmp instruction:
  2863. ce->c.ip = ce->c.ip + s + 1, and the ip will not be pushed onto the stack.
  2864.  
  2865. {0x17, "ret", pop, pret}, /* pop ip from stack */
  2866.  
  2867.      This instruction causes the value at the top of the stack to be popped
  2868. into the instruction pointer and the stack pointer to be decremented (modulus
  2869. STACK_SIZE).  There are no conditions under which this instruction fails.
  2870.  
  2871. {0x18, "mov_cd", movdd, pmov_dc}, /* dx = cx */
  2872.  
  2873.      This instruction copies the contents of the cx register into the dx
  2874. register, leaving the value in cx intact.  The flaw may cause the source
  2875. register to actually be bx or dx and the destination register to actually
  2876. be cx or ax.  This instruction could fail if the value placed in the dx
  2877. register would be outside of the range -SoupSize to SoupSize, in which case
  2878. the original value in the dx register remains, and a flag is set.
  2879.  
  2880. {0x19, "mov_ab", movdd, pmov_ba}, /* bx = ax */
  2881.  
  2882.      This instruction copies the contents of the ax register into the bx
  2883. register, leaving the value in ax intact.  The flaw may cause the source
  2884. register to actually be bx or dx and the destination register to actually
  2885. be cx or ax.  This instruction could fail if the value placed in the cx
  2886. register would be outside of the range -SoupSize to SoupSize, in which case
  2887. the original value in the cx register remains, and a flag is set.
  2888.  
  2889. {0x1a, "moviab", movii, pmoviab},
  2890.  
  2891.      This instruction copies one instruction in the soup to another location
  2892. in the soup.  The source instruction is at the address contained in the
  2893. bx register, and the destination is the address contained in the ax register.
  2894.  
  2895.      This instruction could fail under the following circumstances:  a) if the
  2896. source and destination addresses are the same, b) if the destination address
  2897. is not owned by this creature and is write protected, c) if the source
  2898. address is not owned by this creature and is read protected, d) if either the
  2899. source or destination addresses are outside the soup.
  2900.  
  2901.      Also, if the destination address is in the daughter, it will perform the
  2902. following operation: ce->d.mov_daught++.  If the destination address is not
  2903. in the daughter cell, it will make a call to MutBookeep(is.dval), since this
  2904. could concievably make a genetic change in another creature (if the other
  2905. creature were not write protected, or if the ``other'' creature were actually
  2906. the one doing the writing).
  2907.  
  2908. {0x1b, "adr", adr, padr}, /* search outward for template, return adr in ax */
  2909.  
  2910.      This instruction causes the ax register to contain the address of the
  2911. instruction following the nearest occurrence of the template complementary
  2912. to the template that follows the adr instruction.  The template is defined
  2913. as the group of consecutive nops (nop_0 or nop_1) that immediately follow the
  2914. adr instruction.  The size of the template is just the number of consecutive
  2915. nops that follow the adr instruction.  The size of the template is placed in
  2916. the cx register.
  2917.  
  2918.      This instruction is a bi-directional search, which means that it will
  2919. search both forward and backward in memory for the complementary template.
  2920. Let a equal the address of the first instruction of the template, and let
  2921. s equal the size of the template.  The forward search starts at the address
  2922. a + s + 1, and the backward search starts at the address a - s - 1.  The
  2923. search looks in the forward direction first, then alternately looks ahead
  2924. or back one additional step until the complementary template is found, or
  2925. the search limit (Search_limit) is reached.  The template searches wrap around
  2926. the ends of the soup.  The instruction pointer is moved past the template used
  2927. by the adr instruction: ce->c.ip = ce->c.ip + s + 1.
  2928.  
  2929.      The instruction will fail if the size of the template following the adr
  2930. instruction is less than MinTemplSize, or greater than SoupSize, or if a
  2931. complementary template is not found within the search radius, Search_limit.
  2932. On failure and the cx register is not altered.
  2933.  
  2934. {0x1c, "adrb", adr, padrb}, /* search backward for template, rtrn adr in ax */
  2935.  
  2936.      This instruction causes the ax register to contain the address of the
  2937. instruction following the nearest occurrence (backwards in the soup) of the
  2938. template complementary to the template that follows the adrb instruction.
  2939. The template is defined as the group of consecutive nops (nop_0 or nop_1) that
  2940. immediately follow the adrb instruction.  The size of the template is just the
  2941. number of consecutive nops that follow the adrb instruction.  The size of the
  2942. template is placed in the cx register.
  2943.  
  2944.      This instruction is a uni-directional search, which means that it will
  2945. search in only one direction (in this case, only backward) in memory for the
  2946. complementary template.  Let a equal the address of the first instruction of
  2947. the template, and let s equal the size of the template.  The backward search
  2948. starts at the address a - s - 1.  The search looks in successive steps
  2949. backwards until the complementary template is found, or the search limit
  2950. (Search_limit) is reached.  The template searches wrap around the ends of the
  2951. soup.  The instruction pointer is moved past the template used by the adrb
  2952. instruction: ce->c.ip = ce->c.ip + s + 1.
  2953.  
  2954.      The instruction will fail if the size of the template following the adrb
  2955. instruction is less than MinTemplSize, or greater than SoupSize, or if a
  2956. complementary template is not found within the search radius, Search_limit.
  2957. On failure the cx register is not altered.
  2958.  
  2959. {0x1d, "adrf", adr, padrf}, /* search forward for template, rtrn adr in ax */
  2960.  
  2961.      This instruction causes the ax register to contain the address of the
  2962. instruction following the nearest occurrence (forwards in the soup) of the
  2963. template complementary to the template that follows the adrf instruction.
  2964. The template is defined as the group of consecutive nops (nop_0 or nop_1) that
  2965. immediately follow the adrf instruction.  The size of the template is just the
  2966. number of consecutive nops that follow the adrf instruction.  The size of the
  2967. template is placed in the cx register.
  2968.  
  2969.      This instruction is a uni-directional search, which means that it will
  2970. search in only one direction (in this case, only forward) in memory for the
  2971. complementary template.  Let a equal the address of the first instruction of
  2972. the template, and let s equal the size of the template.  The forward search
  2973. starts at the address a + s + 1.  The search looks in successive steps
  2974. forwards until the complementary template is found, or the search limit
  2975. (Search_limit) is reached.  The template searches wrap around the ends of the
  2976. soup.  The instruction pointer is moved past the template used by the adrf
  2977. instruction: ce->c.ip = ce->c.ip + s + 1.
  2978.  
  2979.      The instruction will fail if the size of the template following the adrf
  2980. instruction is less than MinTemplSize, or greater than SoupSize, or if a
  2981. complementary template is not found within the search radius, Search_limit.
  2982. On failure the cx register is not altered.
  2983.  
  2984. {0x1e, "mal", malchm, pmal}, /* allocate & chmod space for a new cell */
  2985.  
  2986.      This instruction requests memory space in the soup from the operating
  2987. system.  The amount of space requested is specified by the value in the cx
  2988. register.  The address of the allocated block is returned in the ax register.
  2989. The allocated block is chmoded (its memory is protected) according to the
  2990. condition specified by the soup_in variable MemModeProt, which has a default
  2991. value of 2 (write privelage protected, but read and execute privelages open).
  2992. In any case the owner of the space retains all privelages.  This instruction
  2993. will increment the instruction pointer by one.  If this instruction is
  2994. executed successfully, this creature will move down the reaper queue one
  2995. position.
  2996.  
  2997.      The operating system begins searching for the requested block from the
  2998. beginning of memory, and allocates the first free block found of the size
  2999. requested.  The allocated block may not wrap around the end of the soup.
  3000. Note that the execution of this instruction usually causes the reaper to kill
  3001. in order to free space to meet the request.  However, the reaper will never
  3002. kill the creature making the request.
  3003.  
  3004.      This instruction can fail under the following circumstances: a) if the
  3005. amount of memory requested is less than or equal to zero (note that a request
  3006. of 1 may be converted into a request of 0 by a flaw), b) if the creature
  3007. already owns a second block of memory whose size is exactly the amount of
  3008. memory requested (in other words, if the creature makes two successive calls
  3009. to mal(), requesting the same amount of memory, without an intervening call
  3010. to divide()), c) if the amount of memory requested is more than MaxMalMult
  3011. times the size of the creature making the request (the default value of
  3012. MaxMalMult is 3).
  3013.  
  3014. {0x1f, "divide", divide, pdivide} /* give life to new cell, put in queues */
  3015.  
  3016.      This instruction causes the mother cell to loose her write privelages
  3017. on the space of the daughter cell, and causes the daughter cell to be
  3018. entered into both the reaper and slicer queues.  The daughter enters the
  3019. bottom of the reaper queue, and enters the slicer queue just behind the mother
  3020. (so the daughter will be the last cell to be reaped and to get another slice).
  3021. This instruction will increment the instruction pointer by one.  If this
  3022. instruction is executed successfully, this creature will move down the reaper
  3023. queue one position.
  3024.  
  3025.      This instruction can fail under the following circumstances: a) if the
  3026. size of the daughter cell is less than soup_in variable MinCellSize (default
  3027. value of 8), b) if the number of instructions written into the space of the
  3028. daughter cell by the mother cell (ce->d.mov_daught) is less than the soup_in
  3029. variable MovPropThrDiv times the size of the daughter cell, c) if the soup_in
  3030. variable DivSameSize is non-zero, and the daughter cell is not the same
  3031. size as the mother cell, d) if the soup_in variable DivSameGen is non-zero
  3032. and the daughter cell is not the same size, or does not have exactly the same
  3033. sequence as the mother cell.
  3034.  
  3035. 9)  THE ANCESTOR & WRITING A CREATURE
  3036.  
  3037.   9.1) The Ancestor
  3038.  
  3039.      The ASCII assembler code file with comments, for the ancestor, is listed
  3040. below.  Below the listing I have some explanatory material.
  3041.  
  3042. **** begin genome file (note blank line at head of file)
  3043.  
  3044. format: 2  bits: 2156009669  EXsh    TCsh    TPs     MFs     MTd     MBh     
  3045. genotype: 0080aaa  parent genotype: 0666god
  3046. 1st_daughter:  flags: 0  inst: 827  mov_daught: 80          breed_true: 1
  3047. 2nd_daughter:  flags: 0  inst: 809  mov_daught: 80          breed_true: 1
  3048. Origin: InstExe: 0,0  clock: 0  Thu Jan 01 -5:00:00 1970
  3049. MaxPropPop: 0.8306  MaxPropInst: 0.4239 mpp_time: 0,0 
  3050. ploidy: 1  track: 0
  3051.  
  3052. track 0: prot
  3053.           xwr
  3054. nop_1   ; 010 110 01   0 beginning marker
  3055. nop_1   ; 010 110 01   1 beginning marker
  3056. nop_1   ; 010 110 01   2 beginning marker
  3057. nop_1   ; 010 110 01   3 beginning marker
  3058. zero    ; 010 110 04   4 put zero in cx
  3059. or1     ; 010 110 02   5 put 1 in first bit of cx
  3060. shl     ; 010 110 03   6 shift left cx (cx = 2)
  3061. shl     ; 010 110 03   7 shift left cx (cx = 4)
  3062. mov_cd  ; 010 110 18   8 move cx to dx (dx = 4)
  3063. adrb    ; 010 110 1c   9 get (backward) address of beginning marker -> ax
  3064. nop_0   ; 010 100 00  10 complement to beginning marker
  3065. nop_0   ; 010 100 00  11 complement to beginning marker
  3066. nop_0   ; 010 100 00  12 complement to beginning marker
  3067. nop_0   ; 010 100 00  13 complement to beginning marker
  3068. sub_ac  ; 010 110 07  14 subtract cx from ax, result in ax
  3069. mov_ab  ; 010 110 19  15 move ax to bx, bx now contains start address of mother
  3070. adrf    ; 010 110 1d  16 get (forward) address of end marker -> ax
  3071. nop_0   ; 010 100 00  17 complement to end marker
  3072. nop_0   ; 010 100 00  18 complement to end marker
  3073. nop_0   ; 010 100 00  19 complement to end marker
  3074. nop_1   ; 010 100 01  20 complement to end marker
  3075. inc_a   ; 010 110 08  21 increment ax, to include dummy instruction at end
  3076. sub_ab  ; 010 110 06  22 subtract bx from ax to get size, result in cx
  3077. nop_1   ; 010 110 01  23 reproduction loop marker
  3078. nop_1   ; 010 110 01  24 reproduction loop marker
  3079. nop_0   ; 010 110 00  25 reproduction loop marker
  3080. nop_1   ; 010 110 01  26 reproduction loop marker
  3081. mal     ; 010 110 1e  27 allocate space (cx) for daughter, address to ax
  3082. call    ; 010 110 16  28 call template below (copy procedure)
  3083. nop_0   ; 010 100 00  29 copy procedure complement
  3084. nop_0   ; 010 100 00  30 copy procedure complement
  3085. nop_1   ; 010 100 01  31 copy procedure complement
  3086. nop_1   ; 010 100 01  32 copy procedure complement
  3087. divide  ; 010 110 1f  33 create independent daughter cell
  3088. jmp     ; 010 110 14  34 jump to template below (reproduction loop)
  3089. nop_0   ; 010 100 00  35 reproduction loop complement
  3090. nop_0   ; 010 100 00  36 reproduction loop complement
  3091. nop_1   ; 010 100 01  37 reproduction loop complement
  3092. nop_0   ; 010 100 00  38 reproduction loop complement
  3093. if_cz   ; 010 000 05  39 dummy instruction to separate templates
  3094. nop_1   ; 010 110 01  40 copy procedure template
  3095. nop_1   ; 010 110 01  41 copy procedure template
  3096. nop_0   ; 010 110 00  42 copy procedure template
  3097. nop_0   ; 010 110 00  43 copy procedure template
  3098. pushax  ; 010 110 0c  44 push ax onto stack
  3099. pushbx  ; 010 110 0d  45 push bx onto stack
  3100. pushcx  ; 010 110 0e  46 push cx onto stack
  3101. nop_1   ; 010 110 01  47 copy loop template
  3102. nop_0   ; 010 110 00  48 copy loop template
  3103. nop_1   ; 010 110 01  49 copy loop template
  3104. nop_0   ; 010 110 00  50 copy loop template
  3105. moviab  ; 010 110 1a  51 move contents of [bx] to [ax] (copy one instruction)
  3106. dec_c   ; 010 110 0a  52 decrement cx (size)
  3107. if_cz   ; 010 110 05  53 if cx == 0 perform next instruction, otherwise skip it
  3108. jmp     ; 010 110 14  54 jump to template below (copy procedure exit)
  3109. nop_0   ; 010 110 00  55 copy procedure exit complement
  3110. nop_1   ; 010 110 01  56 copy procedure exit complement
  3111. nop_0   ; 010 110 00  57 copy procedure exit complement
  3112. nop_0   ; 010 110 00  58 copy procedure exit complement
  3113. inc_a   ; 010 110 08  59 increment ax (address in daughter to copy to)
  3114. inc_b   ; 010 110 09  60 increment bx (address in mother to copy from)
  3115. jmp     ; 010 110 14  61 bidirectional jump to template below (copy loop)
  3116. nop_0   ; 010 100 00  62 copy loop complement
  3117. nop_1   ; 010 100 01  63 copy loop complement
  3118. nop_0   ; 010 100 00  64 copy loop complement
  3119. nop_1   ; 010 100 01  65 copy loop complement
  3120. if_cz   ; 010 000 05  66 this is a dummy instruction to separate templates
  3121. nop_1   ; 010 110 01  67 copy procedure exit template
  3122. nop_0   ; 010 110 00  68 copy procedure exit template
  3123. nop_1   ; 010 110 01  69 copy procedure exit template
  3124. nop_1   ; 010 110 01  70 copy procedure exit template
  3125. pop_cx  ; 010 110 12  71 pop cx off stack (size)
  3126. pop_bx  ; 010 110 11  72 pop bx off stack (start address of mother)
  3127. pop_ax  ; 010 110 10  73 pop ax off stack (start address of daughter)
  3128. ret     ; 010 110 17  74 return from copy procedure
  3129. nop_1   ; 010 100 01  75 end template
  3130. nop_1   ; 010 100 01  76 end template
  3131. nop_1   ; 010 100 01  77 end template
  3132. nop_0   ; 010 100 00  78 end template
  3133. if_cz   ; 010 000 05  79 dummy instruction to separate creature
  3134. **** end genome file
  3135.  
  3136.      Each genome file begins with some header information.  Let me explain
  3137. each item:
  3138.  
  3139.      format: 2  because we occasionally change the format of the genome files,
  3140. this parameter is included for backwards compatibility.  It is used by the
  3141. assembler/disassembler to know how to read and write the files.
  3142.  
  3143.      bits: 2156009669 this is the bit field associated with each genome in
  3144. the genebank.  If the genebanker is on and if any of the parameters: WatchExe,
  3145. WatchMov, or WatchTem are set to a non-zero value, then bits in this field
  3146. will be set to characterize the ecological characteristics of the genotype.
  3147. The definitions of the bits in the field are given in the tierra.h module,
  3148. and above in the description of the soup_in parameters.  For more specific
  3149. details, follow the Watch variables in the source modules to see exactly what
  3150. they are doing.
  3151.  
  3152.      EXsh TCsh TPs MFs MTd MBh this is an ASCII summary of the meaning of
  3153. the bits that are set in the bit field.  The meanings of these abbreviations
  3154. are given in the tierra.h file and above in the description of the soup_in
  3155. parameters.
  3156.  
  3157.      genotype: 0080aaa  This is the name of this genotype.  The name has two
  3158. parts.  The first part is numeric and must be equal to the size of the cell
  3159. of this creature (the size of its allocated block of memory).  The cell size
  3160. usually, but not always, corresponds to the size of the genome.  The second
  3161. part is a unique (and arbitrary) three letter code to distinguish this
  3162. particular genotype from others of the same size.
  3163.  
  3164.      parent genotype: 0666god  This is the name of the genotype of the
  3165. immediate ancestor of this genotype.  The immediate ancestor is the creature,
  3166. whose cpu gave rise to the first individual of this genotype.  The original
  3167. creature, 0080aaa was created by god and the devil.  This information is
  3168. deficient in three respects.  First, the creature whose cpu created the
  3169. offspring is not necessarily the genetic parent of the creature.
  3170. Hyper-parasites for example, force other creatures to replicate their genomes.
  3171. Second, the immediate ancestor of a creature may have gone extinct before it
  3172. crossed the threshold, so its genotype may not appear in the genebank.
  3173. Third, in the case where the immediate ancestor went extinct without being
  3174. saved in the genebank, its name becomes available for reuse.  This means
  3175. that even if you find another creature with the right name in the genebank,
  3176. there is no certainty that it is actually the ancestor you are looking for.
  3177. In short, this information is essentially useless.  This is the problem
  3178. that is most actively being worked on at the moment.  A seamless phylogeny
  3179. tracker is under development.
  3180.  
  3181.      1st_daughter:  flags: 0  inst: 827  mov_daught: 80  breed_true: 1
  3182. This is a set of metabolic data about what transpired during the production
  3183. of the first daughter by this genotype.  flags: 0  This tells us how many
  3184. errors (flags) were generated during the first reproduction.  The generation
  3185. of errors indicates invalid execution of instructions and causes the creature
  3186. to move up the reaper queue, closer to death.  inst: 827 This tells us how
  3187. many instructions were executed during the first reproduction, this is an
  3188. indication of metabolic costs and efficiency.  mov_daught: 80  This tells us
  3189. how many instructions were copied from the mother to the daughter during the
  3190. first reproduction.  breed_true: 1  This tells us if the first daughter ever
  3191. has the same genotype as the mother.
  3192.  
  3193.      2nd_daughter:  flags: 0  inst: 809  mov_daught: 80  breed_true: 1
  3194. This is a set of metabolic data about what transpired during the production
  3195. of the second daughter by this genotype.  The data are the same as those
  3196. from the first daughter.  The second daughter and those that follow generally
  3197. have the same metabolic data, but they also generally differ from the first
  3198. daughter, because the second time through, the parent often does not examine
  3199. itself again, and it does not start the algorithm from the same place.
  3200.  
  3201.      Origin InstExe: 0,0  clock: 0  Thu Jan 01 -5:00:00 1970
  3202.      InstExe: 0,0  At the time this genotype first appeared, the system had
  3203. executed this many of instructions.  The number to the left of the comma
  3204. is the number of millions of instructions, and the number to the right of the
  3205. comma is the remainder.  clock: 0  This is the system clock time at the first
  3206. origin of this genotype.  Wed Dec 26 22:56:08 1990  This is the system clock
  3207. time at the first origin of this genotype.
  3208.  
  3209.      MaxPropPop: 0.8306  MaxPropInst: 0.4239 mpp_time: 0,0 
  3210.      MaxPropPop: 0.8306  The maximum proportion of the population of adult
  3211. cells in the soup, attained by this genotype.  MaxPropInst: 0.4239  The
  3212. maximum proportion of space in the soup attained by adults of this genotype.
  3213. mpp_time: 0,0  The time at which this genotype achived its maximum proportion
  3214. of the population of cells (MaxPropPop).  Time here is measured in millions
  3215. of instructions (to the left of the comma) and the remainder (to the right
  3216. of the comma).
  3217.  
  3218.      ploidy: 1  track: 0
  3219.      ploidy: 1  The ploidy level of this genotype (i.e., this genotype
  3220. is haploid).  track: 0  Which copy of the genome will start executing at
  3221. birth.  This is only used when the ploidy level is greater than one
  3222. (i.e., diploid).
  3223.  
  3224. track 0: prot
  3225.           xwr
  3226. nop_1   ; 010 110 01   0 beginning marker
  3227.  
  3228.      track 0: prot  This tells us that the assembler code that follows is
  3229. track one.  If the genotype has a ploidy of 2, a second assembler listing
  3230. will follow, and it will be labeled track 1.  The word prot refers to the
  3231. protection bits: xwr, or x = execute, w = write, r = read.
  3232.  
  3233. nop_1   ; 010 110 01   0 beginning marker
  3234.  
  3235.      This is the first line of the actual genome.  The first word, nop_1 is
  3236. the assembler mnemonic for one of the two no-operation instructions.  The
  3237. semicolon indicates the beginning of comments.
  3238.  
  3239.      The digits 010 tell us what protection this instruction will have at
  3240. birth.  Only the write bit is set, so this instruction will be write
  3241. protected, but open to reading or execution at birth.
  3242.  
  3243.      The digits 110 are a record of which instructions were executed by this
  3244. creature's own CPU (first digit), and the CPUs of other creatures' (second
  3245. digit), the third digit is not used at present.  These bits are set when the
  3246. WatchExe parameter is set.  That the first two digits are set to one indicates
  3247. that this instruction was executed both by its own CPU and by the CPU of
  3248. another creature (perhaps a parasite, or a lost instruction pointer).
  3249.  
  3250.      The digits 01 are the actual hexadecimal op code of the instruction.  It
  3251. is this value that will actually be stored in the soup.
  3252.  
  3253.      The digit 0 just before the words ``beginning marker'' is a count of
  3254. the Nth instruction in the genome.  This is the first instruction, so it is
  3255. numbered zero.
  3256.  
  3257.      The words ``beginning marker'' are a comment describing the intended
  3258. purpose of this instruction.
  3259.  
  3260.      If you study the code of the ancestor, you may be perplexed by the
  3261. reason for including the following instructions:
  3262.  
  3263. zero    ; 010 110 04   4 put zero in cx
  3264. or1     ; 010 110 02   5 put 1 in first bit of cx
  3265. shl     ; 010 110 03   6 shift left cx (cx = 2)
  3266. shl     ; 010 110 03   7 shift left cx (cx = 4)
  3267. mov_cd  ; 010 110 18   8 move cx to dx (dx = 4)
  3268.  
  3269.      In the original version of the simulator, the size of the templates
  3270. was determine by the value in the dx register.  These five instructions
  3271. loaded the dx register with the value 4, which is the size of the templates
  3272. in this creature.  Later, it was decided that this was a stupid way to
  3273. determine template sizes.  Now the parser just looks to see how many nops
  3274. follow any instruction using them, and the number of consecutive nops
  3275. determine the template size.  Therefore, these five instructions don't do any
  3276. useful work in the present model, but they have been left in place because
  3277. the code still works.
  3278.  
  3279.   9.2) Writing a Creature
  3280.  
  3281.      If you write your own creature, you must obey the following conventions:
  3282.  
  3283. **** begin genome file (note blank line at top of file)
  3284.  
  3285. format: 2  bits: 3
  3286. genotype: 0080aaa  parent genotype: 0666god
  3287.  
  3288. track 0: prot
  3289.           xwr
  3290. nop_1   ; 010
  3291. nop_1   ; 010
  3292. **** end genome file
  3293.  
  3294.      Yank the above lines into the file you are going to write, to use as
  3295. a template.  You must have the following:
  3296.  
  3297.      1) a blank line at the top of the file.
  3298.      2) a line declaring the format and bits, just use the line given.
  3299.      3) a line stating the genome size and three letter name, and that of
  3300.         the parent genotype.  The genome size must match the actual number
  3301.         of instructions in the genome.  The three letter name is arbitrary,
  3302.         you can make up any name, but I advise using a low letter name like
  3303.         aaa because these names are used in a base 26 numbering system by
  3304.         the genebanker, and the genebanker must allocate an array as big
  3305.         as the largest of these numbers.  You may make up the parent genotype
  3306.         size and name, it won't be used for anything, so its details don't
  3307.         matter, but it should have the format of four numeric digits followed
  3308.         by three letters.
  3309.      4) a blank line
  3310.      5) the line: track 0: prot, just use the line provided
  3311.      6) the line:           xwr, just use the line provided
  3312.      7) the listing of assembler mnemonics, followed by a semicolon and a
  3313.         three digit code indicating the protection at birth.  I recomment that
  3314.         you use the protection indicated.  The listing of the 32 assembler
  3315.         mnemonics can be found at the end of the soup_in.h file.  For a
  3316.         description of what they actually do, study the comments on the
  3317.         code of the ancestor listed above, and study the corresponding
  3318.         parser and execute functions in the two modules in parse.c and
  3319.         instruct.c.
  3320.  
  3321. 10)  IF YOU WANT TO MODIFY THE SOURCE CODE
  3322.  
  3323.      If you make some significant improvements to Tierra, we would welcome
  3324. receiving the source code, so that we may integrate it into our version, and
  3325. then make it available to others.  We will credit you for your contributions.
  3326.  
  3327.      All lines of source code should be 78 characters or less, or it will
  3328. mess up the formatting of the code for distribution by mail.
  3329.  
  3330.      The simulator has been designed so that it can be brought down, and then
  3331. brought back up where it left off.  This means that there can be no static
  3332. local variables.  Any variables that hang around must be global.  They
  3333. are declared and defined in soup_in.h if they are also soup_in parameters.
  3334. Otherwise they are declared in declare.h, and all global variables are
  3335. declared as externals in extern.h.
  3336.  
  3337.      The code for bringing the simulator up and down is in the tsetup.c
  3338. module.  The system is brought up by GetSoup(), which calls GetAVar()
  3339. to read soup_in.  All soup_in variables are read by the GetAVar() function.
  3340. If a new simulation is being started, GetSoup() calls GetNewSoup().  If an
  3341. old simulation is being restarted, GetSoup() calls GetOldSoup().  GetOldSoup()
  3342. will read all global variables not contained in soup_in, and will also read
  3343. in all arrays, such as the soup, the cells array, and the free_mem array.
  3344. When the simulator goes down, and periodically during a run, all global
  3345. variables are written to a file soup_out, and all global arrays such as
  3346. soup, the cells array, the free_mem array, and the random number generator
  3347. array, and some structures, are written to a binary file called core_out.
  3348. Thus if you create any new global variables or arrays, be sure they are read
  3349. by GetOldSoup(), and written by WriteSoup().
  3350.  
  3351.      There are several obvious projects that I would like to comment on:
  3352.  
  3353.   10.1) Creating a Frontend
  3354.  
  3355.      All I/O to the console is routed through the frontend.c module, so that
  3356. it can be handled by a variety of frontends now under development.  The
  3357. simplest of these just uses printf to write to standard out.  If you
  3358. compile with #define FRONTEND BASIC, you will get the new frontend created
  3359. by Dan Pirone.  The Basic frontend consists of five data area:
  3360. The STATS area at the top two lines of the screen.
  3361. The PLAN area next for displaying simlation variable every million virtual
  3362.     instruction.
  3363. The MESSAGE area, for state changes, and Genebank data.
  3364. The ERROR area at the second to the last line of the screen.
  3365. The HELP area at the last line of the screen.
  3366.  
  3367. If your are going to work on the frontend, please observe the Basic code
  3368. as a template for changes, or get back to us for an updated version of 
  3369. the frontend.c module.  
  3370.  
  3371.   10.2) Creating New Instruction Sets
  3372.  
  3373.      If you want to create a new instruction set, more power to you.  The
  3374. relevant modules to study are: instruct.c, parse.c, soup_in.h, arginst.h,
  3375. configur.h, and opcode.map.  You will also need to study the definitions of
  3376. struct cpu, struct InstDef, struct ArgInstDef, and struct inst, all in the
  3377. tierra.h module.  Note that the cpu structure includes an array of registers.
  3378. The idea is that you may change the size of this array to make just about any
  3379. changes you might want to the CPU architecture.  You should avoid actually
  3380. having to alter the structure definitions in the tierra.h file.  You may
  3381. alter the correspondence between opcodes and instructions by editing the
  3382. opcode.map file.
  3383.  
  3384.   10.3) Creating New Slicer Mechanisms
  3385.  
  3386.      If you want to experiment with artificial rather than natural selection,
  3387. consider that selection is both a carrot and a stick.  The carrot in this
  3388. model is CPU time which is allocated by the slicers.  The stick is the reaper.
  3389. If you want to try to evolve algorithms that do useful work, your evaluation
  3390. functions should be embedded into the slicer, and should allocate more CPU
  3391. time to creatures who rank high.  You can also do the same with the reaper.
  3392.  
  3393.   10.4) Creating a Sexual Model
  3394.  
  3395.      Sex emerges spontaneously in runs whenever parasites appear.  However,
  3396. this sex is primitive and disorganized.  I believe that the easiest way to
  3397. engineer organized sex is to work with diploid creatures.  The infrastructure
  3398. to allow multiple ploidy levels is already in place.  Notice that the
  3399. definition of Instruction, the type of which the soup is composed is:
  3400.  
  3401. typedef struct Inst  Instruction[PLOIDY];
  3402.  
  3403.      This means that if PLOIDY is defined as two, there are two parallel
  3404. tracks for genomes.  The instruction pointer will run down the track
  3405. specified by the ce->c.tr variable in the cpu structure.  We have not
  3406. implemented any other controls over the tracking of the instruction pointer
  3407. in diploid or higher models.  This is future work.
  3408.  
  3409.   10.5) Creating a Multi-cellular Model
  3410.  
  3411.      Multi-cellularity was the hallmark of the Cambrian explosion of
  3412. diversity, and thus is likely a biological feature worth including in Tierra.
  3413. Also, it is likely that a multi-cellular model is the appropriate one for
  3414. evolving large application programs on massively parallel machines.  How
  3415. can we implement multi-cellularity?  What does it mean in the context of
  3416. Tierran creatures?
  3417.  
  3418.      Consider that at the conceptual core, multi-cellularity means that the
  3419. mother cell determines what portion of the genome its daughter cell will
  3420. express.  For many daughter cells, the mother cells narrows their options
  3421. by preventing them from expressing (executing) large portions of their
  3422. genome (code).  In the organic world this is done by loading the daughter
  3423. cell with regulatory proteins which determine which genes will be expressed.
  3424.  
  3425.      In the Tierran world, the same result can be achieved by allowing the
  3426. mother cell to set the position of the instruction pointer in the daughter
  3427. cell, and also the initial values of the CPU registers.  These acts can
  3428. place the daughter cell into a portion of its code from which it may never
  3429. be able to reach certain other parts of its code.  In this way the mother
  3430. cell determines what parts of the code are executed by the daughter.
  3431.  
  3432.      To facilitate this process, the divide instruction has been broken into
  3433. three steps: 1) Create and initialize a CPU for the daughter.  2) Start the
  3434. daughter CPU running.  3) Become independent from the daughter by loosing
  3435. write privelages on the daughter space.  Now, between steps 1 and 2, the
  3436. mother can place values into the CPU registers and instruction pointer of
  3437. the daughter.  This will require and inter-CPU move instruction.  The divide
  3438. instruction takes an argument that determines which of the three steps is
  3439. being performed.
  3440.  
  3441. 11) KNOWN BUGS
  3442.  
  3443.      Memory management for the DOS version is very tricky, and is not yet
  3444. air tight.  During any run using the genebank, the demand for memory grows
  3445. as genomes accumulate in RAM.  Eventually the memory fills up, and the
  3446. memory management routines swap extinct genomes out to disk.  When a lot
  3447. of genomes are swapped to disk, the system thrashes in the swapping of
  3448. genomes between RAM and disk.  Eventually some memory request will fail due
  3449. to memory fragmentation or the accumulation of too many living genomes in
  3450. RAM, and the system will come down.  At this point just bring the system
  3451. back up by typing: tierra soup_out.  Bringing the system down and back up
  3452. should eliminate the memory fragmentation, and effect some garbage collection,
  3453. freeing up more memory.  It is actually a good idea to bring the system
  3454. up and down on DOS machines before they run out of memory, just to clear
  3455. the memory.  You can tell if you are running out of memory by selecting the
  3456. i-info option from the menu.  At the upper left of the screen you will then
  3457. see a message like: Coreleft = 4400.  This tells you that the system is out
  3458. of memory (Tierra is not allowed to use the last 4K of memory).
  3459.  
  3460.      When the system is brought down, and then brought back up where it left
  3461. off, it continues writing birth and death records to the tierra.run or
  3462. break.X files.  However, if the system comes down due to being killed or
  3463. due to a hardware crash, when it is brought back up, it will resume execution
  3464. from the state when the simulator was last saved (see SaveFreq variable
  3465. in section 7 above).  The problem is that the birth and death records will
  3466. now be appended to the end of the file that contained all records up to the
  3467. last buffered write before the crash.  This means that the last part of the
  3468. birth and death records will be incorrect.
  3469.  
  3470. 12) IF YOU HAVE PROBLEMS
  3471.  
  3472.   12.1) Problems with Installation
  3473.  
  3474.      Read the installation instructions carefully.  Where we present
  3475. alternative methods, try them all.  If it still doesn't work, please
  3476. let us know.  We would like to help people with installation, and make
  3477. sure that our instructions are clear.  If you are using a compiler or
  3478. machine we have not tested, we may not be able to help you, but we want
  3479. to accomodate these additional conditions.  We would like to help you
  3480. find a solution and incorporate the solution in future releases.
  3481.  
  3482.   12.2) Problems Running Tierra
  3483.  
  3484.      Read all of the .doc files.  You may find the answer there.  If a
  3485. problem still persists, and you have ftp access, get a new copy of the
  3486. source code out of the ftp site.  It is likely that the source code will be
  3487. updated on a roughly monthly or bimonthly basis as we continue to improve
  3488. the program.  By the time you are sure there is a problem, we may already
  3489. have fixed it and placed a fix in the ftp site.
  3490.  
  3491.      If the problem still persists after you have tested the latest version
  3492. of the software, let us know about the problem.  We would like to fix it.
  3493. If you do not have ftp access, and you identify a bug, we will fix it and
  3494. send you a free upgrade if you return you original distribution disk in
  3495. a disk mailer.
  3496.  
  3497. 13) REGISTRATION & MAILING LISTS
  3498.  
  3499.      The reason you might want to register your copy of the software is so
  3500. that we can contact you if we discover a bug, or we can let you know when
  3501. new versions of the program are ready for distribution.  If you obtained
  3502. Tierra on disk, send your name, address and the serial number of your
  3503. distribution disk to Virtual Life at the address listed below.  If you
  3504. obtained Tierra from the ftp site, send you email address to:
  3505.  
  3506. tierra-request@life.slhs.udel.edu
  3507.  
  3508.      There is a mailing list for Tierra users. (actually 2, but you only want
  3509. to be on one of them).  The first list is for people who only want to get the
  3510. official announcements, updates and bug-fixes.  The other will carry the 
  3511. official postings, and are intended for discussion of tierra by users.
  3512. This one is distributed in digest form, when there is enough material.
  3513. The lists are:
  3514.  
  3515. tierra-announce    official updates, patches and announcements only
  3516. tierra-digest      discussion, updates, etc. (digest form)
  3517.  
  3518. The addresses are: 
  3519.  
  3520. tierra-request@life.slhs.udel.edu   the list administrator. to be added,
  3521.                                     removed, or complain about problems with
  3522.                                     any of these lists.
  3523.  
  3524. tierra-digest@life.slhs.udel.edu    to post to the list.
  3525.  
  3526. tierra-bug@life.slhs.udel.edu       for bug-reports or questions about the
  3527.                                     code or installation.
  3528.  
  3529.      You may also be interested in the Artificial Life mailing list.
  3530. Subscribe to the list by sending a message to:
  3531.  
  3532. alife-request@cognet.ucla.edu
  3533.  
  3534.      Post to the list by sending a message to:
  3535.  
  3536. alife@cognet.ucla.edu
  3537.  
  3538. Tom Ray
  3539. Virtual Life
  3540. P.O. Box 625
  3541. Newark, DE 19715
  3542.  
  3543. From January through August, we will be at:
  3544.  
  3545. Tom Ray
  3546. Santa Fe Institute
  3547. 1660 Old Pecos Trail, Suite A
  3548. Santa Fe, NM 87501
  3549. ray@santafe.edu
  3550. 505-984-8800
  3551. 505-982-0565 (FAX)
  3552.  
  3553. From September through December, we will be at:
  3554.  
  3555. Tom Ray
  3556. University of Delaware
  3557. School of Life & Health Sciences
  3558. Newark, Delaware  19716
  3559. ray@udel.edu
  3560. 302-831-2753
  3561. 302-831-2281 (FAX)
  3562.