home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD2.mdf / c / library / xplatfrm / tierra / readme.t2 < prev    next >
Encoding:
Text File  |  1992-04-26  |  50.7 KB  |  1,025 lines

  1.  
  2. 6)  LISTING OF DISTRIBUTION FILES
  3.  
  4. The distribution includes the following files:
  5.  
  6. README.T1 & README.T2 - this file, on line documentation
  7.  
  8. arg.c - the main module for the assembler/disassembler, written by Tom Uffner.
  9.      This program converts ascii assembler files into binary files which can
  10.      be executed by the Tierran virtual computer
  11.  
  12. arg.prj - the Turbo C V 2.0 project file for compiling the
  13.      assember/disassembler
  14.  
  15. arginst.h - a file containing a structure used by arg.c to map assembler
  16.      mnemonics to executable opcodes.
  17.  
  18. bookeep.c - source code for bookeeping routines, which keep track of how many
  19.      of what kind of creatures are in the soup, and other stuff like that.
  20.  
  21. ccarg - a file for compiling the assembler/disassembler on unix systems.
  22.      This file should be made executable (chmod +x ccarg).
  23.  
  24. cctierra - a file for compiling Tierra on unix systems.
  25.      This file should be made executable (chmod +x cctierra).
  26.  
  27. configur.h - a file for configuring Tierra.  You probably won't need to
  28.      touch this unless you get into advanced stuff.
  29.  
  30. debug.h - this file claims to provide some useful debugging stuff, I don't
  31.      know, I didn't create it.
  32.  
  33. declare.h - all global variables are declared in this file, except those
  34.      whose values are set by soup_in.  Those globals are declared in soup_in.h.
  35.      declare.h is included by tierra.c which contains the main function.
  36.  
  37. depend - a listing of interdependencies of the source code files
  38.  
  39. extern.h - all global variables are delcared as extern in this file, and this
  40.      file is included by all *.c files except tierra.c which includes
  41.      delcare.h instead.
  42.  
  43. extract.c - functions for extracting creatures from the soup and saving their
  44.      genomes to disk.
  45.  
  46. frontend.c - functions for handling input/output for Tierra.  Hopefully this
  47.      module will grow in the near future as we put a better interface on
  48.      Tierra.
  49.  
  50. genebank.c - functions for managing the genebank.  This module has benefited
  51.      from a lot of work by Tom Uffner.
  52.  
  53. genio.c - functions for input/output of creatures.  This stuff is also used
  54.      by arg.c, the assembler/disassembler.  This module has benefited from
  55.      a lot of work by Tom Uffner.
  56.  
  57. instruct.c - this module contains generalized executable functions.  These
  58.      generalized functions are mapped to specific functions by the parsing
  59.      functions in the parse.c module.
  60.  
  61. memalloc.c - functions for handling memory allocation in the soup, the stuff
  62.      that ``cell membranes'' are made of.
  63.  
  64. parse.c - the parsing functions interpret the executable code of the creatures,
  65.      and map it onto the executable functions contained in the instruct.c
  66.      module.
  67.  
  68. portable.c - functions for portability between operating systems.
  69.  
  70. portable.h - definitions for portability between operating systems and
  71.      architectures.
  72.  
  73. prototyp.h - all functions in Tierra are prototyped here.
  74.  
  75. queues.c - queue management functions for the slicer and reaper queues. 
  76.  
  77. slicers.c - interchangeable slicer functions.  This file contains some
  78.      experiments in the allocation of cpu time to creatures.  This is
  79.      an interesting thing to play with.
  80.  
  81. soup_in - the ascii file read by Tierra on startup, which contains all
  82.      the global parameters that determine the environment, and a list of
  83.      creatures to use in innoculating the soup at the start of a run.
  84.  
  85. soup_in.h - this file defines the default values of all the soup_in variables,
  86.      and defines the instruction set by mapping the assember mnemonics to the
  87.      opcodes, parser functions, and executables.
  88.  
  89. tierra.c - this file contains the main function, and the central code
  90.      driving the virtual computer.
  91.  
  92. tierra.h - this file contains all the structure definitions.  It is a good
  93.      source of documentation for anyone trying to understand the code.
  94.  
  95. tierra.prj - the Turbo C V. 2.0 project file for compiling Tierra.
  96.  
  97. trand.c - random number generation routines from Numerical Recipes in C.
  98.  
  99. tsetup.c - routines called when Tierra starts up and comes down.  Tom Uffner
  100.      has been putting some work into this module as well.
  101.  
  102. geneban1: - a subdirectory containing the genomes of the creatures saved
  103.      during a run.
  104.  
  105. 0080aaa.tie - the ancestor, written by a human, mother of all other creatures.
  106.  
  107. 0022abn.tie - the smallest non-parasitic self-replicating creature to evolve.
  108.  
  109. 0045aaa.tie - the archtypical parasite
  110.  
  111. 0072etq.tie - a phenomenal example of optimization through evolution,
  112.      involving the unrolling of the copy loop.
  113.  
  114. list - a list of genotypes in the genebank, which will be read by Tierra
  115.      at startup.  All genotypes listed in soup_in must also be listed in
  116.      this file.  This file will be written to when the system is saved.
  117.      Therefore to start a fresh run, you must start with a fresh copy of
  118.      the list file.  Therefore we provide the two files below, list4580 and
  119.      list80, which allow you to make a fresh start either with the genome
  120.      0080aaa, or 0080aaa and 0045aaa together.
  121.  
  122. list4580 - a fresh list file for starting runs with the genotypes 0080aaa and
  123.      0045aaa together.  To use this file just copy it to a file named list.
  124.  
  125. list80 - a fresh list file for starting runs with the genotype 0080aaa
  126.      To use this file just copy it to a file named list.
  127.  
  128. tiedat: - a subdirectory where a complete record of births and deaths will
  129.      be written.
  130.  
  131. break.1 - a file containing a record of births and deaths.
  132.  
  133. 7)  SOUP_IN PARAMETERS
  134.  
  135. A typical soup_in file looks like the following:
  136.  
  137. /* begin soup_in file */
  138.  
  139. tierra core: 6-10-91 
  140.  
  141. alive = 50            how many millions of instruction will we run
  142. BrkupSiz = 5120      size of output file in K, named break.1, break.2 ...
  143. CellsSize = 600       initial size of cells array of structures
  144. debug = 0               0 = off, 1 = on, printf statements for debugging
  145. DiskOut = 1            output data to disk (1 = on, 0 = off)
  146. DistFreq = .1       frequency of disturbance, factor of recovery time
  147. DistProp = .4       proportion of population affected by distrubance
  148. DivSameGen = 1 cells must produce offspring of same genotype, to stop evolution
  149. DivSameSiz = 0 cells must produce offspring of same size, to stop size change
  150. DropDead = 5 stop system if no reproduction in the last x million instructions
  151. GeneBnker = 1   turn genebanker on and off
  152. GenebankPath = geneban1/  path for genebanker output
  153. GenPerBkgMut = 12 mutation rate control by generations ("cosmic ray")
  154. GenPerFlaw = 16       flaw control by generations
  155. GenPerMovMut = 8    mutation rate control by generations (copy mutation)
  156. hangup = 1            0 = exit on error, 1 = hangup on error for debugging
  157. MaxFreeBlocks = 500     initial number of structures for memory allocation
  158. MaxMalMult = 3        multiple of cell size allowed for mal()
  159. MinCellSize = 8       minimum size for cells
  160. MinTemplSize = 3       minimum size for templates
  161. MovPropThrDiv = .7       minimum proportion of daughter cell filled by mov
  162. new_soup = 1          1 = this a new soup, 0 = restarting an old run
  163. NumCells = 3      number of creatures and gaps used to inoculate new soup
  164. OutPath = tiedat/  path for data output
  165. PhotonPow = 1.5               power for photon match slice size
  166. PhotonWidth = 8               amount by which photons slide to find best fit
  167. PhotonWord = chlorophill      word used to capture photon
  168. RamBankSiz = 20000 array size for genotypes in ram, use with genebanker
  169. SaveFreq = 10        frequency of saving core_out, soup_out and list
  170. SavThrMem = .015  threshold memory occupancy to save genotype
  171. SavThrPop = .015  threshold population proportion to save genotype
  172. SearchLimit = 5
  173. seed = 0 seed for random number generator, 0 uses time to set seed
  174. SizDepSlice = 0  set slice size by size of creature
  175. SlicePow = 1    set power for slice size, use when SizDepSlice = 1
  176. SliceSize = 25    slice size when SizDepSlice = 0
  177. SliceStyle = 2   choose style of determining slice size
  178. SlicFixFrac = 0   fixed fraction of slice size
  179. SlicRanFrac = 2   random fraction of slice size
  180. SoupSize = 60000 size of soup in instructions
  181. WatchExe = 0     mark executed instructions in genome in genebank
  182. WatchMov = 0     set mov bits in genome in genebank
  183. WatchTem = 0     set template bits in genome in genebank
  184.  
  185. 0080aaa
  186. 0045aaa
  187. 0080aaa
  188.  
  189. /* end soup_in file */
  190.  
  191. The meaning of each of these parameters is explained below:
  192.  
  193. alive = 50           how many millions of instruction will we run
  194.  
  195.      This tells the simulator how long to run, in millions of instructions.
  196.  
  197. BrkupSiz = 5120      size of output file in K, named break.1, break.2 ...
  198.  
  199.      If this value is set to zero (0) the record of births and deaths will
  200. be written to a single file named tierra.run.  However, if BrkupSiz has a
  201. non-zero value, birth and death records will be written to a series of files
  202. with the names break.1, break.2, etc.  Each of these files will have the
  203. size specified, in K (1024 bytes).  The value 5120 indicates that the
  204. break files will each be five megabytes in size.  The output file(s) will
  205. be in the path specified by OutPath (see below).  See also DiskOut.
  206.  
  207. CellsSize = 600       initial size of cells array of structures
  208.  
  209.      The initial size of the ``cells array'' which contains all the demographic
  210. data, as well as the CPU of each creature.  Due to a bug in the Borland
  211. Turbo C farrealloc function, care must be taken to be sure that this array
  212. is initially large enough that it does not need to be reallocated.  A good
  213. rule of thumb is to let CellsSize = SoupSize / 100.  If a compiler other than
  214. Borland is used, don't worry, any initial value will do.
  215.  
  216. debug = 0               0 = off, 1 = on, printf statements for debugging
  217.  
  218.      This is used during code development, to turn on and off print statements
  219. for debugging purposes.
  220.  
  221. DiskOut = 1            output data to disk (1 = on, 0 = off)
  222.  
  223.      If this parameter is set to zero (0), no birth and death records will
  224. be saved.  Any other value will cause birth and death records to be saved
  225. to a file whose name is discussed under BrkupSiz above, in the path discussed
  226. under OutPath below.
  227.  
  228. DistFreq = .1       frequency of disturbance, factor of recovery time
  229.  
  230.      The frequency of disturbance, as a factor of recovery time.  This and
  231. the next option control the pattern of disturbance.  If you do not want the
  232. system to be disturbed, set DistFreq to a negative value.  If DistFreq has
  233. a non-negative value, when the soup fills up the reaper will be invoked to
  234. kill cells until it has freed a proportion DistProp of the soup.  The system
  235. will then keep track of the time it takes for the creatures to recover from
  236. the disturbance by filling the soup again.  Let's call this recovery time:
  237. rtime.  The next disturbance will occur: (rtime X DistFreq) after recovery
  238. is complete.  Therefore, if DistFreq = 0, each disturbance will occur
  239. immediately after recovery is complete.  If DistFreq = 1, the time between
  240. disturbances will be twice the recovery time, that is, the soup will remain
  241. full for a period equal to the recovery time, before another disturbance hits.
  242.  
  243. DistProp = .4       proportion of population affected by distrubance
  244.  
  245.      The proportion of the soup that is freed of cells by each disturbance.
  246. The occurs by invoking the reaper to kill cells until the total amount of
  247. free memory is greater than or equal to: (DistProp X SoupSize).  Note that
  248. cells are not killed at random, they are killed off the top of the reaper
  249. queue.
  250.  
  251. DivSameGen = 0 cells must produce offspring of same genotype, to stop evolution
  252.  
  253.      This causes attempts at cell division to abort if the offspring is of
  254. a genotype different from the parent.  This can be used when the mutation rates
  255. are set to zero, to prevent sex from causing evolution.
  256.  
  257. DivSameSiz = 0 cells must produce offspring of same size, to stop evolution
  258.  
  259.      Like DivSameGen, but cell division aborts only if the offspring is of
  260. a different size than the parent.  Changes in genotype are not prevented,
  261. only changes in size are prevented.
  262.  
  263. DropDead = 5 stop system if no reproduction in the last x million instructions
  264.  
  265.      Sometimes the soup dies, such as when mutation rates are too high.
  266. This parameter watches the time elapsed since the last cell division, and
  267. brings the system down if it is greater than DropDead million instructions.
  268.  
  269. GeneBnker = 1   turn genebanker on and off
  270.  
  271.      The parameter turns the genebanker on and off.  The value zero turns
  272. the genebanker off, any other value turns it on.  With the genebanker off,
  273. the record of births and deaths will contain the sizes of the creatures,
  274. but not their genotypes.  Also no genomes will be saved in the genebank.
  275. When the genebanker is turned on, the record of births and deaths will
  276. contain a three letter unique name for each genotype, as well as the size
  277. of the creatures.  Also, any genome whose frequency exceeds the thresholds
  278. SavThrMem and SavThrPop (see below) will be saved to the genebank, in
  279. the path indicated by GenebankPath (see below).
  280.  
  281. GenebankPath = geneban1/  path for genebanker output
  282.  
  283.      This is a string variable which describes the path to the genebank
  284. where the genomes will be saved.  The path name should be terminated by
  285. a forward slash.
  286.  
  287. GenPerBkgMut = 12    mutation rate control by generations ("cosmic ray")
  288.  
  289.      Control of the background mutation rate ("cosmic ray").  The value 12
  290. indicates that in each generation, roughly one in twelve cells will be hit
  291. by a mutation.  These mutations occur completely at random, and also affect
  292. free space where there are no cells.  If the value of GenPerBkgMut were 0.5,
  293. it would mean that in each generation, each cell would be hit by roughly
  294. two mutations.
  295.  
  296. GenPerFlaw = 16       flaw control by generations
  297.  
  298.      Control of the flaw rate.  The value 16 means that in each generation,
  299. roughly one in sixteen individuals will experience a flaw.  Flaws cause
  300. instructions to produce results that are in error by plus or minus one,
  301. in some sense.  If the value of GenPerFlaw were 0.5, it would mean that in
  302. each generation, each cell would be hit by roughly two flaws.
  303.  
  304. GenPerMovMut = 8    mutation rate control by generations (copy mutation)
  305.  
  306.      Control of the move mutation rate (copy mutation).  The value 8
  307. indicates that in each generation, roughly one in eight cells will be hit
  308. by a mutation.  These mutations only affect copies of instructions made
  309. during replication (by the double indirect mov instruction).  When an
  310. instruction is affected by a mutation, one of its five bits is selected
  311. at random and flipped.  If the value of GenPerMovMut were 0.5, it would
  312. mean that in each generation, each cell would be hit by roughly two mutations.
  313.  
  314. hangup = 1            0 = exit on error, 1 = hangup on error for debugging
  315.  
  316.      If an error occurs which is serious enough to bring down the system,
  317. having hangup set to 1 will prevent the program from exiting.  In this case,
  318. the program will hang in a simple loop so that it remains active for
  319. debugging purposes.
  320.  
  321. MaxFreeBlocks = 500     initial number of structures for memory allocation
  322.  
  323.      There is an array of structures used for the virtual memory allocator.
  324. This parameter sets the initial size of the allocated array, at startup.
  325.  
  326. MaxMalMult = 3        multiple of cell size allowed for mal()
  327.  
  328.      When a cell attempts to allocate a second block of memory (presumably
  329. to copy its genome into), this parameter is checked.  If the amount of memory
  330. requested is greater than MaxMalMult times the size of the mother cell, the
  331. request will fail.  This prevents mutants from requesting the entire soup,
  332. which would invoke the reaper to cause a massive kill off.
  333.  
  334. MinCellSize = 8       minimum size for cells
  335.  
  336.      When a cell attempts to divide, this parameter is checked.  If the
  337. daughter cell would be smaller than MinCellSize instructions, divide will
  338. fail.  The reason this is needed is that with no lower limit, there is a
  339. tendency for some mutants to spawn large numbers of very small cells.
  340.  
  341. MinTemplSize = 3       minimum size for templates
  342.  
  343.      When an instruction (like jump) attempts to use a template, this parameter
  344. is checked.  If the actual template is smaller than MinTemplSize instructions,
  345. the instruction will fail.  This is a matter of taste.
  346.  
  347. MovPropThrDiv = .7       minimum proportion of daughter cell filled by mov
  348.  
  349.      When a cell attempts to divide, this parameter is checked.  If the mother
  350. cell has moved less than MovPropThrDiv times the mother cell size, of
  351. instructions into the daughter cell, cell division will abort.  A value of .7
  352. means that the mother must at least fill the daughter 70% with instructions
  353. (though all these instructions could have been moved to the same spot in
  354. the daughter cell).  The reason this parameter exists is that without it,
  355. mutants will attempt to spew out large numbers of empty cells.
  356.  
  357. new_soup = 1          1 = this a new soup, 0 = restarting an old run
  358.  
  359.      This value is checked on startup, to determine if this is a new soup,
  360. or if this is restarting an old run where it left off.  When the system
  361. comes down, all soup_in parameter (and many other global variables) are
  362. saved in a file called soup_out.  The value of new_soup is set to 0 in
  363. soup_out.  In order to restart an old run, just use soup_out as the input
  364. file rather than soup_in.  This is done by using soup_out as a command line
  365. parameter at startup: tierra soup_out
  366.  
  367. NumCells = 5      number of creatures and gaps used to inoculate new soup
  368.  
  369.      This parameter is checked at startup, and the system will look for a
  370. list of NumCells creatures at the end of the soup_in file.  The value 5
  371. indicates that the soup will initially be innoculated by five cells.
  372. However, NumCells also counts gaps that are placed between cells (without
  373. gaps, all cells are packed together at the bottom of the soup at startup).
  374. The gap control feature does not work at present, so don't use it.  Notice
  375. that after the list of parameters in the soup_in file, there is a blank
  376. line, followed by a list of genotypes.  The system will read the first 
  377. NumCells genotypes from the list, and place them in the soup in the same
  378. order that they occur in the list.
  379.  
  380. OutPath = tiedat/  path for data output
  381.  
  382.      The record of births and deaths will be written to files in a directory
  383. specified by OutPath.  See BrkupSiz above for a discussion of the name of
  384. the file(s) containing the birth and death records.
  385.  
  386. PhotonPow = 1.5         power for photon match slice size
  387.  
  388.      If SliceStyle (see below) is set to the value 1, then the allocation
  389. of CPU cycles to creatures is based on a photon - chlorophyll metaphor.
  390. Imagine that photons are raining down on the soup at random.  The cell hit
  391. by the photon gets a time slice that is proportional to the goodness of fit
  392. between the pattern of instructions that are hit, and an arbitrary pattern
  393. (defined by PhotonWord, see below).
  394.  
  395.      The template of instructions defined by PhotonWord is laid over the
  396. sequence of instructions at the site hit by the photon.  The number of
  397. instructions that match between the two is used to determine the slice
  398. size.  However, the number of matching instructions is raised to the power
  399. PhotonPow, to calculate the slice size.
  400.  
  401. PhotonWidth = 8   amount by which photons slide to find best fit
  402.  
  403.      When a photon hits the soup, it slides a distance PhotonWidth, counting
  404. the number of matching characters at each position, and the slice size will
  405. be equal to the number of characters in the best match (raised to the power
  406. PhotonPow, see above).  If PhotonWidth equals 8, the center of the template
  407. will start 4 instructions to the left of the site hit by the photon, and
  408. slide to 4 instructions to the right of the site hit.
  409.  
  410. PhotonWord = chlorophill  word used to capture photon
  411.  
  412.      This string determines the arbitrary pattern that absorbs the photon.
  413. It uses a base 32 numbering system: the digits 0-9 followed by the characters
  414. a-v.  The characters w, x, y and z are not allowed (that is why chlorophyll
  415. is misspelled).  The string may be any length up to 79 characters.
  416.  
  417. RamBankSiz = 20000 array size for genotypes in ram, use with genebanker
  418.  
  419.      Places an upper limit on the number of genomes that may be stored
  420. in the genebank maintained in RAM at any one time.  This is a memory
  421. management feature provided for DOS systems.  When the RAM genebank
  422. fills, genomes start swapping out to disk.  The genomes that have not
  423. been checked for the longest time are swapped out first.  At this time
  424. the RAM bank management scheme does not work.  For this reason, you should
  425. be sure that this parameter is set high enough that the bank does not
  426. fill up during the run.
  427.  
  428. SaveFreq = 10        frequency of saving core_out, soup_out and list
  429.  
  430.      Every SaveFreq million instructions, the complete state of the
  431. virtual machine is saved.  This is a useful feature for long runs, so that
  432. the system can be restarted if it is interrupted for some reason.
  433.  
  434. SavThrMem = .015  threshold memory occupancy to save genotype
  435.  
  436.      If a particular genotype fills SavThrMem of the total space available
  437. in the soup, it will be assigned a permanent unique name, and saved to disk.
  438. Note that an adjustment is made because only adult cells are counted, and
  439. embryos generally fill half the soup.  Therefore adult cells of a particular
  440. genotype need only occupy SavThrMem * 0.5 of the space to be saved.
  441.  
  442. SavThrPop = .015  threshold population proportion to save genotype
  443.  
  444.      If a particular genotype amounts to SavThrPop of the total population
  445. of (adult) cells in the soup, it will be assigned a permanent unique name,
  446. and saved to disk.
  447.  
  448. SearchLimit = 5
  449.  
  450.      This parameter controls how far instructions may search to match
  451. templates.  The value five means that search is limited to five times the
  452. average adult cell size.  The actual distance is updated every million
  453. instructions.
  454.  
  455. seed = 0 seed for random number generator, 0 uses time to set seed
  456.  
  457.      The seed for the random number generator.  If you use the value zero,
  458. the system clock is used to set the seed.  If you use any other value, it
  459. will be the seed.  The starting seed (even when provided by the clock) will
  460. be written to standard output, and also saved in the soup_out file when the
  461. simulator comes down.  By using the original seed and all the same initial
  462. parameter settings in soup_in, a run may be repeated exactly.
  463.  
  464. SizDepSlice = 0  set slice size by size of creature
  465.  
  466.      This determines a major slicer option.  If this parameter is set to
  467. zero, the slice size will either be a constant set by SliceSize (see below)
  468. or a uniform random variate, or a mix of the two.  The mix is determined by
  469. the relative values of SlicFixFrac and SlicRanFrac (see below).  The actual
  470. slice size will be:
  471.  
  472. (SlicFixFrac * SliceSize) + (tlrand() % (I32s) ((SlicRanFrac * SliceSize) + 1))
  473.  
  474.      If SizDepSlice is set to a non-zero value, the slice size will be
  475. proportional to the size of the genome.  In this case, the base slice size
  476. will be the genome size raised to the power SlicePow (see below).  To clarify
  477. let slic_siz = genome_size ^ SlicePow, the actual slice size will be:
  478.  
  479. (SlicFixFrac * slic_siz) + (tlrand() % (I32s) ((SlicRanFrac * slic_siz) + 1))
  480.  
  481. SlicePow = 1    set power for slice size, use when SizDepSlice = 1
  482.  
  483.      This parameter is only used when SizDepSlice = 1.  In this case, the
  484. genome size is raised to the power SlicePow to determine the slice size
  485. (see algorithm under SizDepSlice above).  If SlicePow = 1, the run will be
  486. size neutral, selection will not be biased toward either large or small
  487. creatures (the probability of an instruction being executed is not dependent
  488. on the size of the genome it is located in).  If SlicePow > 1, selection will
  489. favor larger genomes.  If SlicePow < 1, selection will favor small genomes.
  490.  
  491. SliceSize = 25    slice size when SizDepSlice = 0
  492.  
  493.      This parameter determines the base slice size when SizDepSlice = 0.
  494. The actual slice size in this case depends on the values of SlicFixFrac
  495. and SlicRanFrac (see below).  The way the slice size is actually calculated
  496. is explained under SizDepSlice above.
  497.  
  498. SliceStyle = 2   choose style of determining slice size
  499.  
  500.      The slicer is a pointer to function, and the function actually used
  501. is determined by this parameter.  At present there are three choices (0-2).
  502. The pointer to function is assigned in the setup.c module, and the slicer
  503. functions themselves are contained in the slicers.c module.
  504. 0 = SlicerQueue() - slice sizes without a random component
  505. 1 = SlicerPhoton() - slice size based on photon interception metaphor
  506. 2 = RanSlicerQueue() - slice size with a fixed and a random component
  507.  
  508. SlicFixFrac = 0   fixed fraction of slice size
  509.  
  510.      When SliceStyle = 2, the slice size has a fixed component and a random
  511. component.  This parameter determines the fixed component as a multiple
  512. of SliceSize, or genome_size ^ SlicePow.
  513.  
  514. SlicRanFrac = 2   random fraction of slice size
  515.  
  516.      When SliceStyle = 2, the slice size has a fixed component and a random
  517. component.  This parameter determines the random component as a multiple
  518. of SliceSize, or genome_size ^ SlicePow.
  519.  
  520. SoupSize = 60000 size of soup in instructions
  521.  
  522.      This variable sets the size of the soup, measured in instructions.
  523.  
  524. WatchExe = 0     mark executed instructions in genome in genebank
  525.  
  526.      If the genebank is on, setting this parameter to a non-zero value
  527. will turn on a watch of which instructions are being executed in each
  528. permanent genotype (this helps to distinguish junk code from code that is
  529. executed), and also, who is executing whose instructions.  There
  530. is a bit field in struct g_list (bit definitions are defined in the tierra.h
  531. module) that keeps track of whether a creature executes its own instructions,
  532. those of another creature, if another creature executes this creatures
  533. instructions, etc:
  534.  
  535.     bit  2  EXs = executes own instructions (self)
  536.     bit  3  EXd = executes daughter's instructions
  537.     bit  4  EXo = executes other cell's instructions
  538.     bit  5  EXf = executes instructions in free memory
  539.     bit  6  EXh = own instructions are executed by other creature (host)
  540.  
  541. WatchMov = 0     set mov bits in genome in genebank
  542.  
  543.      If the genebank is on, setting this parameter to a non-zero value
  544. will turn on a watch of who moves whose instructions and where.  This
  545. information is recorded in the bit field in struct g_list:
  546.  
  547.     bit 17  MFs = moves instruction from self
  548.     bit 18  MFd = moves instruction from daughter
  549.     bit 19  MFo = moves instruction from other cell
  550.     bit 20  MFf = moves instruction from free memory
  551.     bit 21  MFh = own instructions are moved by other creature (host)
  552.     bit 22  MTs = moves instruction to self
  553.     bit 23  MTd = moves instruction to daughter
  554.     bit 24  MTo = moves instruction to other cell
  555.     bit 25  MTf = moves instruction to free memory
  556.     bit 26  MTh = is written on by another creature (host)
  557.     bit 27  MBs = executing other creatures code, moves inst from self
  558.     bit 28  MBd = executing other creatures code, moves inst from daughter
  559.     bit 29  MBo = executing other creatures code, moves inst from other cell
  560.     bit 30  MBf = executing other creatures code, moves inst from free memory
  561.     bit 31  MBh = other creature uses another cpu to move your instructions
  562.  
  563. WatchTem = 0     set template bits in genome in genebank
  564.  
  565.      If the genebank is on, setting this parameter to a non-zero value
  566. will turn on a watch of whose templates are matched by whom.  This
  567. information is recorded in the bit field in struct g_list:
  568.  
  569.     bit  7  TCs = matches template complement of self
  570.     bit  8  TCd = matches template complement of daughter
  571.     bit  9  TCo = matches template complement of other
  572.     bit 10  TCf = matches template complement of free memory
  573.     bit 11  TCh = own template complement is matched by other creature (host)
  574.     bit 12  TPs = uses template pattern of self
  575.     bit 13  TPd = uses template pattern of daughter
  576.     bit 14  TPo = uses template pattern of other
  577.     bit 15  TPf = uses template pattern of free memory
  578.     bit 16  TPh = own template pattern is used by other creature (host)
  579.  
  580. 0080aaa
  581. 0045aaa
  582. 0080aaa
  583. 0045aaa
  584. 0080aaa
  585.  
  586.      This is the list of cells that will be loaded into the soup when
  587. the simulator starts up.  This example indicates that five cells will
  588. be loaded at startup, the ancestor 0080aaa alternating with the parasite
  589. 0045aaa.  These cells will be loaded in the bottom of the soup, with no
  590. space between them.  Only NumCells genotypes from the list will actually
  591. be loaded, so the NumCells parameter should be modified when you change
  592. the number of genotypes that you wish to have loaded.  Also, all genotypes
  593. to be loaded must also be listed in the file geneban1/list, and all of the
  594. genotypes must occur in the genebank.
  595.  
  596. 8)  THE ANCESTOR & WRITING A CREATURE
  597.  
  598.   8.1) The Ancestor
  599.  
  600.      The ASCII assembler code file with comments, for the ancestor, is listed
  601. below.  Below the listing I have some explanatory material.
  602.  
  603. **** begin genome file (note blank line at head of file)
  604.  
  605. format: 1  bits: 45750471  EXsh TCsh TPs MFsofh MTdf MB
  606. genotype: 0080aaa  parent genotype: 0666god
  607. 1st_daughter:  flags: 0  inst: 827  mov_daught: 80  breed_true: 1
  608. 2nd_daughter:  flags: 0  inst: 809  mov_daught: 80  breed_true: 1
  609. InstExe.m: 0  InstExe.i: 0  origin: 662270168  Wed Dec 26 22:56:08 1990
  610. MaxPropPop: 0.8306  MaxPropInst: 0.4239
  611. ploidy: 1  track: 0
  612.  
  613. track 0: prot
  614.           xwr
  615. nop_1   ; 010 110 01   0 beginning marker
  616. nop_1   ; 010 110 01   1 beginning marker
  617. nop_1   ; 010 110 01   2 beginning marker
  618. nop_1   ; 010 110 01   3 beginning marker
  619. zero    ; 010 110 04   4 put zero in cx
  620. or1     ; 010 110 02   5 put 1 in first bit of cx
  621. shl     ; 010 110 03   6 shift left cx (cx = 2)
  622. shl     ; 010 110 03   7 shift left cx (cx = 4)
  623. mov_cd  ; 010 110 18   8 move cx to dx (dx = 4)
  624. adrb    ; 010 110 1c   9 get (backward) address of beginning marker -> ax
  625. nop_0   ; 010 100 00  10 complement to beginning marker
  626. nop_0   ; 010 100 00  11 complement to beginning marker
  627. nop_0   ; 010 100 00  12 complement to beginning marker
  628. nop_0   ; 010 100 00  13 complement to beginning marker
  629. sub_ac  ; 010 110 07  14 subtract cx from ax, result in ax
  630. mov_ab  ; 010 110 19  15 move ax to bx, bx now contains start address of mother
  631. adrf    ; 010 110 1d  16 get (forward) address of end marker -> ax
  632. nop_0   ; 010 100 00  17 complement to end marker
  633. nop_0   ; 010 100 00  18 complement to end marker
  634. nop_0   ; 010 100 00  19 complement to end marker
  635. nop_1   ; 010 100 01  20 complement to end marker
  636. inc_a   ; 010 110 08  21 increment ax, to include dummy instruction at end
  637. sub_ab  ; 010 110 06  22 subtract bx from ax to get size, result in cx
  638. nop_1   ; 010 110 01  23 reproduction loop marker
  639. nop_1   ; 010 110 01  24 reproduction loop marker
  640. nop_0   ; 010 110 00  25 reproduction loop marker
  641. nop_1   ; 010 110 01  26 reproduction loop marker
  642. mal     ; 010 110 1e  27 allocate space (cx) for daughter, address to ax
  643. call    ; 010 110 16  28 call template below (copy procedure)
  644. nop_0   ; 010 100 00  29 copy procedure complement
  645. nop_0   ; 010 100 00  30 copy procedure complement
  646. nop_1   ; 010 100 01  31 copy procedure complement
  647. nop_1   ; 010 100 01  32 copy procedure complement
  648. divide  ; 010 110 1f  33 create independent daughter cell
  649. jmp     ; 010 110 14  34 jump to template below (reproduction loop)
  650. nop_0   ; 010 100 00  35 reproduction loop complement
  651. nop_0   ; 010 100 00  36 reproduction loop complement
  652. nop_1   ; 010 100 01  37 reproduction loop complement
  653. nop_0   ; 010 100 00  38 reproduction loop complement
  654. if_cz   ; 010 000 05  39 dummy instruction to separate templates
  655. nop_1   ; 010 110 01  40 copy procedure template
  656. nop_1   ; 010 110 01  41 copy procedure template
  657. nop_0   ; 010 110 00  42 copy procedure template
  658. nop_0   ; 010 110 00  43 copy procedure template
  659. push_ax ; 010 110 0c  44 push ax onto stack
  660. push_bx ; 010 110 0d  45 push bx onto stack
  661. push_cx ; 010 110 0e  46 push cx onto stack
  662. nop_1   ; 010 110 01  47 copy loop template
  663. nop_0   ; 010 110 00  48 copy loop template
  664. nop_1   ; 010 110 01  49 copy loop template
  665. nop_0   ; 010 110 00  50 copy loop template
  666. mov_iab ; 010 110 1a  51 move contents of [bx] to [ax] (copy one instruction)
  667. dec_c   ; 010 110 0a  52 decrement cx (size)
  668. if_cz   ; 010 110 05  53 if cx == 0 perform next instruction, otherwise skip it
  669. jmp     ; 010 110 14  54 jump to template below (copy procedure exit)
  670. nop_0   ; 010 110 00  55 copy procedure exit complement
  671. nop_1   ; 010 110 01  56 copy procedure exit complement
  672. nop_0   ; 010 110 00  57 copy procedure exit complement
  673. nop_0   ; 010 110 00  58 copy procedure exit complement
  674. inc_a   ; 010 110 08  59 increment ax (address in daughter to copy to)
  675. inc_b   ; 010 110 09  60 increment bx (address in mother to copy from)
  676. jmp     ; 010 110 14  61 bidirectional jump to template below (copy loop)
  677. nop_0   ; 010 100 00  62 copy loop complement
  678. nop_1   ; 010 100 01  63 copy loop complement
  679. nop_0   ; 010 100 00  64 copy loop complement
  680. nop_1   ; 010 100 01  65 copy loop complement
  681. if_cz   ; 010 000 05  66 this is a dummy instruction to separate templates
  682. nop_1   ; 010 110 01  67 copy procedure exit template
  683. nop_0   ; 010 110 00  68 copy procedure exit template
  684. nop_1   ; 010 110 01  69 copy procedure exit template
  685. nop_1   ; 010 110 01  70 copy procedure exit template
  686. pop_cx  ; 010 110 12  71 pop cx off stack (size)
  687. pop_bx  ; 010 110 11  72 pop bx off stack (start address of mother)
  688. pop_ax  ; 010 110 10  73 pop ax off stack (start address of daughter)
  689. ret     ; 010 110 17  74 return from copy procedure
  690. nop_1   ; 010 100 01  75 end template
  691. nop_1   ; 010 100 01  76 end template
  692. nop_1   ; 010 100 01  77 end template
  693. nop_0   ; 010 100 00  78 end template
  694. if_cz   ; 010 000 05  79 dummy instruction to separate creature
  695. **** end genome file
  696.  
  697.      Each genome file begins with some header information.  Let me explain
  698. each item:
  699.  
  700.      format: 1  because we occasionally change the format of the genome files,
  701. this parameter is included for backwards compatibility.  It is used by the
  702. assembler/disassembler to know how to read and write the files.
  703.  
  704.      bits: 45750471  this is the bit field associated with each genome in the
  705. genebank.  If the genebanker is on and if any of the parameters: WatchExe,
  706. WatchMov, or WatchTem are set to a non-zero value, then bits in this field
  707. will be set to characterize the ecological characteristics of the genotype.
  708. The definitions of the bits in the field are given in the tierra.h module,
  709. and above in the description of the soup_in parameters.  For more specific
  710. details, follow the Watch variables in the source modules to see exactly what
  711. they are doing.
  712.  
  713.      EXsh TCsh TPs MFsofh MTdf MB this is an ASCII summary of the meaning of
  714. the bits that are set in the bit field.  The meanings of these abbreviations
  715. are given in the tierra.h file and above in the description of the soup_in
  716. parameters.
  717.  
  718.      genotype: 0080aaa  This is the name of this genotype.  The name has two
  719. parts.  The first part is numeric and must be equal to the size of the cell
  720. of this creature (how large is its allocated block of memory).  The cell size
  721. usually, but not always, corresponds to the size of the genome.  The second
  722. part is a unique (and arbitrary) three letter code to distinguish this
  723. particular genotype from others of the same size.
  724.  
  725.      parent genotype: 0666god  This is the name of the genotype of the
  726. immediate ancestor of this genotype.  The immediate ancestor is the creature,
  727. whose cpu gave rise to the first individual of this genotype.  The original
  728. creature, 0080aaa was created by god and the devil.
  729.  
  730.      1st_daughter:  This is a set of metabolic data about what transpired
  731. during the production of the first daughter by this genotype.  flags: 0  This
  732. tells us how many errors (flags) were generated during the first reproduction.
  733. The generation of errors indicates invalid execution of instructions and causes
  734. the creature to move up the reaper queue, closer to death.  inst: 827  This
  735. tells us how many instructions were executed during the first reproduction,
  736. this is an indication of metabolic costs and efficiency.  mov_daught: 80  This
  737. tells us how many instructions were copied from the mother to the daughter
  738. during the first reproduction.  breed_true: 1  This tells us if the first
  739. daughter ever has the same genotype as the mother.
  740.  
  741.      2nd_daughter:  flags: 0  inst: 809  mov_daught: 80  breed_true: 1
  742. This is a set of metabolic data about what transpired during the production
  743. of the second daughter by this genotype.  The data are the same as those
  744. from the first daughter.  The second daughter and those that follow generally
  745. have the same metabolic data, but they also generally differ from the first
  746. daughter, because the second time through, the parent often does not examine
  747. itself again, and it does not start the algorithm from the same place.
  748.  
  749.      InstExe.m: 0  At the time this genotype first appeared, the system had
  750. executed this many millions of instructions, plus the remainder indicated
  751. by the InstExe.i parameter.
  752.  
  753.      InstExe.i: 0  At the time this genotype first appeared, the system had
  754. executed this many instructions, plus however many millions indicated by
  755. the InstExe.m parameter.
  756.  
  757.      origin: 662270168  This is the system clock time at the first origin
  758. of this genotype.
  759.  
  760.      Wed Dec 26 22:56:08 1990  This is the system clock time at the first
  761. origin of this genotype.
  762.  
  763.      MaxPropPop: 0.8306  The maximum proportion of the population of cells of
  764. adult cells in the soup, attained by this genotype.
  765.  
  766.      MaxPropInst: 0.4239  The maximum proportion of space in the soup attained
  767. by adults of this genotype.
  768.  
  769.      ploidy: 1  The ploidy level of this genotype (i.e., this genotype
  770. is haploid).
  771.  
  772.      track: 0  Which copy of the genome will start executing at birth.  This
  773. is only used when the ploidy level is greater than one (i.e., diploid).
  774.  
  775. track 0: prot
  776.           xwr
  777. nop_1   ; 010 110 01   0 beginning marker
  778.  
  779.      track 0: prot  This tells us that the assembler code that follows is
  780. track one.  If the genotype has a ploidy of 2, a second assembler listing
  781. will follow, and it will be labeled track 1.  The word prot refers to the
  782. protection bits: xwr, or x = execute, w = write, r = read.
  783.  
  784. nop_1   ; 010 110 01   0 beginning marker
  785.  
  786.      This is the first line of the actual genome.  The first word, nop_1 is
  787. the assembler mnemonic for one of the two no-operation instructions.  The
  788. semicolon indicates the beginning of comments.
  789.  
  790.      The digits 010 tell us what protection this instruction will have at
  791. birth.  Only the write bit is set, so this instruction will be write protected,
  792. but open to reading or execution at birth.
  793.  
  794.      The digits 110 are a record of which instructions were executed by this
  795. creature's own CPU (first digit), and the CPUs of other creatures' (second
  796. digit), the third digit is not used at present.  These bits are set when the
  797. WatchExe parameter is set.  That the first two digits are set to one indicates
  798. that this instruction was executed both by its own CPU and by the CPU of
  799. another creature (perhaps a parasite, or a lost instruction pointer).
  800.  
  801.      The digits 01 are the actual hexadecimal op code of the instruction.  It
  802. is this value that will actually be stored in the soup.
  803.  
  804.      The digit 0 just before the words ``beginning marker'' is a count of
  805. the Nth instruction in the genome.  This is the first instruction, so it is
  806. numbered zero.
  807.  
  808.      The words ``beginning marker'' are a comment describing the intended
  809. purpose of this instruction.
  810.  
  811.      If you study the code of the ancestor, you may be perplexed by the
  812. reason for including the following instructions:
  813.  
  814. zero    ; 010 110 04   4 put zero in cx
  815. or1     ; 010 110 02   5 put 1 in first bit of cx
  816. shl     ; 010 110 03   6 shift left cx (cx = 2)
  817. shl     ; 010 110 03   7 shift left cx (cx = 4)
  818. mov_cd  ; 010 110 18   8 move cx to dx (dx = 4)
  819.  
  820.      In the original version of the simulator, the size of the templates
  821. was determine by the value in the dx register.  These five instructions
  822. loaded the dx register with the value 4, which is the size of the templates
  823. in this creature.  Later, it was decided that this was a stupid way to
  824. determine template sizes.  Now the parser just looks to see how many nops
  825. follow any instruction using them, and the number of consecutive nops determine
  826. the template size.  Therefore, these five instructions don't do any useful
  827. work in the present model, but they have been left in place because the code
  828. still works.
  829.  
  830.   8.2) Writing a Creature
  831.  
  832.      If you write your own creature, you must obey the following conventions:
  833.  
  834. **** begin genome file (note blank line at top of file)
  835.  
  836. format: 1  bits: 3
  837. genotype: 0080aaa  parent genotype: 0666god
  838.  
  839. track 0: prot
  840.           xwr
  841. nop_1   ; 010
  842. nop_1   ; 010
  843. **** end genome file
  844.  
  845.      Yank the above lines into the file you are going to write, to use as
  846. a template.  You must have the following:
  847.  
  848.      1) a blank line at the top of the file.
  849.      2) a line declaring the format and bits, just use the line given.
  850.      3) a line stating the genome size and three letter name, and that of
  851.         the parent genotype.  The genome size must match the actual number
  852.         of instructions in the genome.  The three letter name is arbitrary,
  853.         you can make up any name, but I advise using a low letter name like
  854.         aaa because these names are used in a base 26 numbering system by
  855.         the genebanker, and the genebanker must allocate an array as big
  856.         as the largerst of these numbers.  You may make up the parent genotype
  857.         size and age, it won't be used for anything, so its details don't
  858.         matter, but it should have the format of four numeric digits followed
  859.         by three letters.
  860.      4) a blank line
  861.      5) the line: track 0: prot, just use the line provided
  862.      6) the line:           xwr, just use the line provided
  863.      7) the listing of assembler mnemonics, followed by a semicolon and a
  864.         three digit code indicating the protection at birth.  I recomment that
  865.         you use the protection indicated.  The listing of the 32 assembler
  866.         mnemonics can be found at the end of the soup_in.h file.  For a
  867.         description of what they actually do, study the comments on the
  868.         code of the ancestor listed above, and study the corresponding
  869.         parser and execute functions in the two modules in parse.c and
  870.         instruct.c.
  871.  
  872. 9)  IF YOU WANT TO MODIFY THE SOURCE CODE
  873.  
  874.      If you make some significant improvements to Tierra, we would welcome
  875. receiving the source code, so that we may integrate it into our version, and
  876. then make it available to others.
  877.  
  878.      All lines of source code should be 78 characters or less, or it will
  879. mess up the formatting of the code for distribution.
  880.  
  881.      The simulator has been designed so that it can be brought down, and then
  882. brought back up where it left off.  This means that there can be no static
  883. local variables.  Any variables that hang around must be global.  They
  884. are declared and defined in soup_in.h if they are also soup_in parameters.
  885. Otherwise they are declared in declare.h, and all global variables are
  886. declared as externals in extern.h.
  887.  
  888.      The code for bringing the simulator up and down is in the tsetup.c
  889. module.  The system is brought up by GetSoup(), which calls GetAVar()
  890. to read soup_in.  All soup_in variables are read by the GetAVar() function.
  891. If a new simulation is being started, GetSoup() calls GetNewSoup().  If an
  892. old simulation is being restarted, GetSoup() calls GetOldSoup().  GetOldSoup()
  893. will read all global variables not contained in soup_in, and will also read
  894. in all arrays, such as the soup, the cells array, and the free_mem array.
  895. When the simulator goes down, and periodically during a run, all global
  896. variables are written to a file soup_out, and all global arrays such as
  897. soup, the cells array, the free_mem array, and the random number generator
  898. array, and some structures, are written to a binary file called core_out.
  899. Thus if you create any new global variables or arrays, be sure they are read
  900. by GetOldSoup(), and written by WriteSoup().
  901.  
  902.      There are several obvious projects that I would like to comment on:
  903.  
  904.   9.1) Creating a Frontend
  905.  
  906.      All I/O to the console is routed through the frontend.c module, so that
  907. it can be handled by a variety of front ends now under development.  The
  908. simplest of these just uses printf to write to standard out.  The frontend.c
  909. module is just a sketch at the moment.  If your are going to work on the
  910. frontend, please get back to us for an updated version of the frontend.c
  911. module.  The module is guaranteed to have been completely rewritten by the
  912. end of October 1991.
  913.  
  914.   9.2) Creating New Instruction Sets
  915.  
  916.      If you want to create a new instruction set, more power to you.  The
  917. relevant modules to study are: instruct.c, parse.c, soup_in.h, arginst.h, and
  918. configur.h.  You will also need to study the definitions of struct cpu,
  919. struct InstDef, struct ArgInstDef, and struct inst, all in the tierra.h module.
  920. Note that the cpu structure includes an array of registers.  The idea is that
  921. you may change the size of this array to make just about any changes you might
  922. want to the CPU architecture.  You should avoid actually having to alter the
  923. structure definition in the tierra.h file.
  924.  
  925.   9.3) Creating New Slicer Mechanisms
  926.  
  927.      If you want to experiment with artificial rather than natural selection,
  928. consider that selection is both a carrot and a stick.  The carrot in this
  929. model is CPU time which is allocated by the slicers.  The stick is the reaper.
  930. If you want to try to evolve algorithms that do useful work, your evaluation
  931. functions should be embedded into the slicer, and should allocate more CPU
  932. time to creatures who rank high.
  933.  
  934.   9.4) Creating a Sexual Model
  935.  
  936.      Sex emerges spontaneously in runs whenever parasites appear.  However,
  937. this sex is primitive and disorganized.  I believe that the easiest way to
  938. engineer organized sex is to work with diploid creatures.  The infrastructure
  939. to allow multiple ploidy levels is already in place.  Notice that the
  940. definition of Instruction, the type of which the soup is composed is:
  941.  
  942. typedef struct Inst  Instruction[PLOIDY];
  943.  
  944.      This means that if PLOIDY is defined as two, there are two parallel
  945. tracks for genomes.  The instruction pointer will run down the track
  946. specified by the ce->c.tr variable in the cpu structure.  We have not
  947. implemented any other controls over the tracking of the instruction pointer
  948. in diploid or higher models.  This is future work.
  949.  
  950.   9.5) Creating a Multi-cellular Model
  951.  
  952.      Multi-cellularity was the hallmark of the Cambrian explosion of
  953. diversity, and thus is likely a biological feature worth including in Tierra.
  954. Also, it is likely that a multi-cellular model is the appropriate one for
  955. evolving large application programs on massively parallel machines.  How
  956. can we implement multi-cellularity?  What does it mean in the context of
  957. Tierran creatures?
  958.  
  959.      Consider that at the conceptual core, multi-cellularity means that the
  960. mother cell determines what portion of the genome its daughter cell will
  961. express.  For many daughter cells, the mother cells narrows their options
  962. by preventing them from expressing (executing) large portions of their
  963. genome (code).  In the organic world this is done by loading the daughter
  964. cell with regulatory proteins which determine which genes will be expressed.
  965.  
  966.      In the Tierran world, the same result can be achieved by allowing the
  967. mother cell to set the position of the instruction pointer in the daughter
  968. cell, and also the initial values of the CPU registers.  These acts can
  969. place the daughter cell into a portion of its code from which it may never
  970. be able to reach certain other parts of its code.  In this way the mother
  971. cell determines what parts of the code are executed by the daughter.
  972.  
  973.      To facilitate this process, the divide instruction has been broken into
  974. three steps: 1) Create and initialize a CPU for the daughter.  2) Start the
  975. daughter CPU running.  3) Become independent from the daughter by loosing
  976. write privelages on the daughter space.  Now, between steps 1 and 2, the
  977. mother can place values into the CPU registers and instruction pointer of
  978. the daughter.  This will require and inter-CPU move instruction.  The divide
  979. instruction takes an argument that determines which of the three steps is
  980. being performed.
  981.  
  982. 10) KNOWN BUGS
  983.  
  984.      When Tierra runs, if the genebanker is on, a growing number of genomes
  985. will accumulate in RAM, causing memory useage to increase throughout a run.
  986. This will eventually lead to a memory allocation failure on DOS systems, or
  987. to thrashing on Unix systems due to the need to use virtual memory.  The
  988. parameter RamBankSiz is designed to prevent the accumulation of too many
  989. genomes in the RAM bank, by swapping out the least used genomes when there
  990. are more than RamBankSize genomes in the genebank.  At present this memory
  991. management does not work.  Even when this is fixed, memory demands will
  992. still grow during a run because the genebanker must keep track of genomes
  993. swapped out to disk.
  994.  
  995.      When compiled with a Borland C compiler, Tierra will use the farrealloc()
  996. function to realloc several arrays during a run.  The farrealloc() function
  997. is supposed to be able to reallocate arrays larger than 64K.  Unfortunately
  998. the function does not work for arrays larger than 64K in most versions of
  999. Borland's compilers.  The most recent versions of Borland C++ have fixed this
  1000. bug.  If you have an older version of the compiler, you can usually avoid
  1001. the problem by setting CellsSize = SoupSize / 100
  1002. This should prevent the need to reallocate the Cells array, which is what
  1003. usually generates the problem.  Just be sure that the initial value of
  1004. CellsSize is large enough that it does not need to be increased.
  1005.  
  1006.      When the system is brought down, and then brought back up where it left
  1007. off, it continues writing birth and death records to the tierra.run or
  1008. break.X files.  However, if the system comes down due to being killed or
  1009. due to a hardware crash, when it is brought back up, it will resume execution
  1010. from the state when the simulator was last saved (see SaveFreq variable
  1011. in section 5 above).  The problem is that the birth and death records will
  1012. now be appended to the end of the a file that contained all records up to the
  1013. last buffered write before the crash.  This means that the last part of the
  1014. birth and death records will be incorrect.  This bug will be fixed soon.
  1015.  
  1016.                              Tom Ray
  1017.                        University of Delaware
  1018.                   School of Life & Health Sciences
  1019.                       Newark, Delaware  19716
  1020.                      ray@tierra.slhs.udel.edu
  1021.                       ray@life.slhs.udel.edu
  1022.                         ray@brahms.udel.edu
  1023.                          302-451-2281 (FAX)
  1024.                             302-451-2753
  1025.