home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 1 / 1887 / README < prev   
Encoding:
Text File  |  1990-12-28  |  12.7 KB  |  220 lines

  1.                 LIFESRC
  2.  
  3.  
  4. The following is a short explanation on how to run the life search program.
  5.  
  6. This program attempts to find life objects which are periodic, which are
  7. spaceships, or which are parents of an object.  You specify a region to
  8. search in, the number of generations of interest, and some initial cells.
  9. The program then searches for all objects which satisfy the conditions.
  10. The search applies transition and implication rules which restrict the number
  11. of possible objects considered to a small fraction of the total number.  This
  12. makes it practical to find these objects in a reasonable amount of time.
  13. (Reasonable ranges from a few minutes to many days, depending on the size
  14. of the search.)
  15.  
  16. The algorithm used here is based on the one described by Dean Hickerson
  17. in his document that was included with the xlife program, and which is also
  18. included with this distribution.  Reading that document will explain how
  19. the search in this program works, except for minor changes.
  20.  
  21. The program usually looks for an object which is periodic in the number of
  22. generations specified by the -g option.  For example, use -g3 to look for
  23. period 3 oscillators or spaceships.  The program is pretty fast for period 2,
  24. satisfactory for period 3, long for period 4, and very long for period 5.
  25.  
  26. By default, the program only finds objects which have the full period specified
  27. by the -g option.  Objects having subperiods of the full period are skipped.
  28. For example, when using -g4, all stable objects or period 2 oscillators will
  29. not be found.  The -a command line option disables this skipping, thus finding
  30. all objects, even those with subperiods.  You probably want to use -a if you
  31. use any of the -tr, -tc, or -p options.
  32.  
  33. The object is limited to the number of rows and columns specified by the -r
  34. and -c options.  Cells outside of this boundary are assumed OFF.  Thus if
  35. any generation of the object would expand out of the box, then the object
  36. will not be found.  The program finds things quicker for a smaller number of
  37. rows and columns.  Searching proceeds from left to right column by column,
  38. and within a column from middle to edge.  It is quicker to search when there
  39. are less rows than columns.
  40.  
  41. The three command line options -r, -c, and -g are always required (unless
  42. you are continuing a search using -l or -ln).  If you do not specify these
  43. options, or give them illegal arguments, a brief message will be output and
  44. the program will exit.  All other options are truly optional.
  45.  
  46. If you want to find a symmetric object, then use the -sr or -sc options.
  47. The -sr option enforces symmetry around the middle row if the number of rows
  48. is odd, or the middle two rows if the number of rows is even.  The -sc option
  49. does the same thing for columns.  You can specify both options to look for
  50. fourfold symmetry.  These options will speed up the search since fewer cells
  51. need examining, but of course will miss all unsymmetric objects.
  52.  
  53. Another way to speed up the search is to use the -m option to limit the
  54. number of ON cells in generation 0.  This will of course miss any
  55. objects which have too many cells.
  56.  
  57. By default, the program looks for purely periodic objects.  To find a
  58. spaceship, you must use the -tr or -tc options to specify a translation.
  59. This makes generation N-1 shift right or down by the specified number of
  60. cells in order to become generation 0.  Thus this finds spaceships which
  61. move leftwards or upwards.  Use -tc to translate columns (thus making
  62. horizontal ships), and -tr to translate rows (thus making vertical ships),
  63. or a combination (thus making diagonal spaceships).  The slowest ship for
  64. any period uses a translation of 1, as for example -tc1.  Remember that the
  65. fastest horizontal speed is C/2 and the fastest diagonal speed is C/4, so
  66. that for example, using -tc2 for a period 3 spaceship will find nothing.
  67.  
  68. By default, the program looks for objects such that generation N-1 implies
  69. generation 0, so that periodic objects can be found.  The -p command line
  70. option disables this circular dependency, so that generation 0 has no past
  71. and generation N-1 has no future.  This enables you to search for the parents
  72. of any object you desire.  Commonly you specify -g2 with this option, to
  73. look only one generation back.  To look for parents of an object, you specify
  74. the cells of the object in generation N-1, and leave the earlier generations
  75. unknown.  The 'c' command is useful with this option to completely specify
  76. the last generation (see below).
  77.  
  78. The search program is always in one of two modes.  It is either in command
  79. mode, or in search mode.  When first started, it is in command mode.
  80. Command mode is indicated by the presence of a "> " prompt.  When in
  81. command mode, you can enter commands to the program, one per line.
  82. To leave command mode and begin searching, you simply enter a blank line.
  83. You can get back to command mode again by generating the SIGINT signal.
  84. When this is done, the program will stop searching at a convenient place,
  85. display the lastest status of the search, and read commands again.  Do not
  86. forget to later type the blank line to continue searching again!
  87.  
  88. When first started, you may wish to specify the state of some cells to
  89. guide the search.  You can specify that any cell in any generation should
  90. be either ON or OFF.  Cells that you do not specify remain unknown.  As an
  91. example, if you were looking for a period 3 oscillator, you might want to
  92. specify the middle cell as being ON in generation 0, and OFF in generation 1.
  93. This would force period 3 behavior.  Note that when you specify cells, the
  94. state specified is permanent.  The program will not reverse your settings,
  95. and therefore can not find any objects which do not match your settings.
  96. Also note that settings unfortunately cannot be corrected, so if you set
  97. the wrong cell by mistake, you must leave the program and start again.
  98.  
  99. To specify a cell, you use the 's' command when in command mode.  This command
  100. takes 2 or 3 arguments.  The first two arguments are the row and column
  101. numbers of the cell to set.  The third number is either 1 for setting the
  102. cell ON, or 0 for setting the cell OFF.  If the third number is omitted,
  103. then ON is assumed.  The cell is always set in the current generation, which
  104. is the one last displayed.  If necessary, you use the 'n' or 'p' commands
  105. to change the current generation to the desired one before using the 's'
  106. command.  For example, if the currently displayed generation is generation 0,
  107. entering "s 5 6" would set the cell at row 5 column 6 of generation 0 to ON,
  108. whereas "s 2 7 0" would set the cell at row 2 column 7 to OFF.  As a shortcut,
  109. you can omit the 's' letter, so that the command "5 6" would set the cell at
  110. row 5 column 6 ON.  If you are using the -sr or -sc options for symmetry, you
  111. don't have to enter the symmetric cells since the program does that for you.
  112.  
  113. You can use the -i or -ia options to input the initial settings for either
  114. generation 0 or the last generation instead of typing in their coordinates
  115. manually as above.  The setting is normally for generation 0, but if the
  116. -p option was also used, then the setting is for the last generation.  The
  117. specified file contains a picture of the cells, with 'O' or '*' indicating
  118. ON, '.' indicating OFF, and '?' indicating unknown.  If you use -i, then
  119. only the ON cells are set, making the OFF cells stay unknown.  If you use
  120. -ia, then both ON and OFF cells are set.  You can still specify additional
  121. cells after the ones in the file have been read.
  122.  
  123. The 'c' command will set all the currently unknown cells in the current
  124. generation to the OFF state.  This is intended to be used when searching
  125. for parents of an object that you have entered, and you know exactly what
  126. the object in the last generation looks like.  This command requires
  127. confirmation before it is acted on.
  128.  
  129. Just before entering command mode, or occasionally if automatic viewing is
  130. enabled, the program will display the current status of the search.
  131. Cells marked as 'O' are ON, cells marked as '.' are OFF, and cells marked
  132. as '?' are currently unknown.  The generation number and the number of ON
  133. cells are also given, along with some of the command line options that were
  134. used to start the program.
  135.  
  136. If you don't like to keep hitting interrupt in order to see the progress of
  137. a search, you can tell the program to automatically display the object every
  138. so often.  This is done either with the -v command line option, or the 'v'
  139. command.  The numeric argument is how many thousand search iterations to
  140. perform between displays.  As an example, the command line option -v1
  141. displays about every 5 seconds for a 20MH 386.
  142.  
  143. Normally if the prog finds something, it will display the object and wait for
  144. commands.  At this point you can write out the object if desired.  Typing 'N'
  145. will continue looking for further objects which work.  If you specified the
  146. -a command line option, then the 'N' command will be needed immediately
  147. after starting a search with no initial settings, since the state of all
  148. OFF cells obviously satisfies all conditions.
  149.  
  150. However, if you specify the -o option on the command line, the program will
  151. NOT stop when it finds an object.  Instead, it will append the found object
  152. to the specified file name, and automatically keep looking for further
  153. objects which work.  The objects stored in the output file are separated
  154. with blank lines.  When no more objects have been found, the program will
  155. print a final status message and exit.
  156.  
  157. The following is a summary of all the commands available.  The 's' command
  158. sets cells and has already been described above.  The 'n' command displays
  159. the next generation of the current object, and will wrap around from the last
  160. generation back to generation 0.  The 'p' command displays the previous
  161. generation, also wrapping around.  The 'w' command writes out a picture of
  162. the current generation out to the specified file.  The 'd' command dumps
  163. the state of the search out to the specified file (see below).  The 'N'
  164. command will continue searching for the next object after an object has
  165. been found.  The 'v' option specifies the frequency of automatic viewing.
  166. The 'c' command turns all unknown cells in the current generation OFF.
  167. Finally, the 'q' command quits the program (confirmation is required).
  168.  
  169. Since it can take a very long time to find something (days or even weeks!),
  170. the current state of a search can be dumped to a file and read again later.
  171. You can explicitly dump the status to a file by using the 'd' command.
  172. After this has been done, you can use 'q' to quit the program.  Then later,
  173. you can use the -l command line option to continue searching.
  174.  
  175. More useful and safer, however, is the autodump feature of the program.
  176. Using the -d command line option causes a dump status file to be automatically
  177. written after every so many search iterations.  Thus every so often the
  178. specified file will contain the latest status of the search.  Then if your
  179. machine crashes, you will not have lost days of work.  The -d option takes a
  180. numeric operand, which is how many thousand searches to perform between dumps.
  181. The option also takes a filename as an argument, and if it isn't given,
  182. defaults to "lifesrc.dmp".  As an example, the option "-d100 foo" results
  183. in automatically dumping status about every 10 minutes to the file "foo".
  184.  
  185. To load the dumped state that has been saved to a file, use the -l or -ln
  186. command line options.  Since the status file contains all information about
  187. the search configuration, you do not need to specify the number of rows,
  188. columns, generations, translations, symmetries, or initial settings again.
  189. However, if you wish autodumps, an output file, or automatic viewing, then
  190. you have to specify those options again.
  191.  
  192. After the state has been loaded, generation 0 is displayed and either the
  193. program enters command mode if -l was used, or else the search immediately
  194. continues where it left off if -ln was used.  The -ln option is provided so
  195. that continuing the search program within shell scripts is easy.
  196.  
  197. There are two versions of the program, called lifesrc and lifesrcdumb.
  198. They perform the same functions, but the user interfaces are slightly
  199. different.  Lifesrc uses the curses display routines to display the
  200. objects prettily, whereas lifesrcdumb assumes nothing fancy and just
  201. prints objects simply.
  202.  
  203. As you can see, finding something requires skill, luck, and patience.
  204. Since you are limiting the search by specifying a rectangle, symmetry,
  205. maximum cells, and initial cells, you probably have to keep varying
  206. these parameters in order to come across something.
  207.  
  208. Example searches are the following:
  209.  
  210.     lifesrc -r5 -c5 -g2 -a            stable and period 2 oscillators
  211.     lifesrc -r10 -c10 -g3 -sr -sc -v1    period 3 oscillator
  212.     lifesrc -r4 -c4 -g4 -tr1 -tc1        glider
  213.     lifesrc -r5 -c7 -g4 -tc2        usual small spaceship
  214.     lifesrc -r5 -c16 -g3 -tr1 -v1        period 3 spaceship
  215.     lifesrc -r5 -c5 -g2 -p -a        parents of glider (needs input)
  216.  
  217. Enjoy searching!
  218.  
  219. -dbell-
  220.