home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 26 / CD_ASCQ_26_1295.iso / vrac / etree202.zip / DOC / ETREE.DOC < prev   
Text File  |  1995-10-12  |  11KB  |  259 lines

  1.           ════════════════════════════════════════════
  2.                         Etree V2.02B 2/10/95
  3.                 Alex J Slater.
  4.              ajs1@cs.waikato.ac.nz
  5.           ════════════════════════════════════════════
  6.  
  7.          Copyright (C) 1995 by Alex J.Slater.
  8.  
  9.   Permission to use and distribute Etree for any purpose and without fee
  10. is hereby granted, provied that you don't make a profit from Etree directly.
  11.  That is, you can use Etree for anything you like, and do what ever
  12. you want with the output, but you CAN'T sell Etree.
  13.  
  14.   For BBS and software distribution sites, a handling fee is allowed to be
  15. charged.
  16.  
  17.   This software is provided "as is" without express or implied warranty.
  18. The author is not responsible for any damage caused by this program.
  19.  
  20.   This program was written using DJGPP v2.0beta3, and version 2.0 of the
  21. GRX graphics library, which is :
  22. "Copyright (c) 1995 Csaba Biegl, 820 Stirrup Dr, Nashville, TN 37221"
  23.  
  24.  DJGPP and GRX are available for ftp from : ftp.idsoftware.com ,
  25. and various other ftp sites.
  26.  
  27.  
  28.                 Introduction.
  29.             ══════════════════════
  30.  
  31.   Etree ( Evolving Trees ) is an artificial evolution program, that
  32. produces a series of "Child" trees from some parent tree(s),
  33. and display the results graphically.
  34.  
  35.   The tree's image is generated according to a series of parameters kept for
  36. each tree ( a "genetic" code ). Once suitable parents are selected, the
  37. program will use the codes (or code if the plant is to be breed with
  38. its self ) of the parent to derive the child trees in a way similar to
  39. organic reproduction.
  40.  
  41.   Each parent's code is split at a random point, and combined to form a
  42. new tree that contains characteristics from each parent. At the time
  43. the generation of new plants there is the possibility of the parameter being
  44. mutated, and so a code that didn't appear in either parent may appear in
  45. the child.
  46.  
  47.   The trees also can develop flowers, and these are slightly different
  48. than other features of the tree, as they are not constant. In that while
  49. the shape and colour of the flower is constant, there is a random
  50. element in their placement, so the same tree redrawn may have a
  51. different distribution of flowers.
  52.  
  53.                  The Program.
  54.             ══════════════════════
  55.     Etree will work in any resolution with a horizontal resolution
  56. greater than or equal to 640, and a vertical resolution of at least
  57. 200. The higher the resolution you can run it in, the better.
  58.  
  59.    The screen is divided into two main areas:
  60. 1. The display area. (top part of the screen with a black background).
  61.     This is where the results of the latest operation are displayed.
  62. 2. The information bar.(bottom part of the screen, with a grey background)
  63.     This contains buttons, and readouts.
  64.  
  65.  
  66.                The Display Area.
  67.             ══════════════════════
  68.     This is where the plants are drawn into. There are six plants drawn
  69. at a time.
  70.  
  71.              The Information Bar.
  72.             ══════════════════════
  73.     This is where the program is controlled from, and where the
  74. program displays information. The information bar has a number of
  75. "buttons" on it that affect the program in various ways, as well as a
  76. information on the current generation.
  77.  
  78.                   Buttons:
  79.             ══════════════════════
  80. From Left to Right (on the screen ) the buttons are :
  81.  
  82. 1. Plant Selector Buttons :
  83.     These are a group of six small buttons, that show which plant/plants
  84. are currently selected for breeding etc. The position of the buttons
  85. corresponds to the positions of the plants in the display area. So the
  86. top left plant selector button shows the status of the top left plant.
  87.     Besides acting as an indicator of what's selected, the buttons also can
  88. be directly clicked if you are using a mouse, or by using the number keys on
  89. the keyboard to select the corresponding plant . The buttons correspond
  90. to these keys :   (if you have a numeric keypad, use that ).
  91.       4 5 6
  92.       1 2 3
  93. 2. Draw Flowers Button :
  94.         This is a 'toggle' button that controls wether or not flowers
  95. are to be drawn. Note: The flowers are still generated and mutated, just
  96. not drawn.
  97.  
  98. 3. Mutation Rate Buttons :
  99.     These are two buttons, one on either side of the mutation rate
  100. display. The button marked with the '+' sign increases the mutation rate
  101. while the button marked '-' decreases the mutation rate. Both buttons
  102. can either be clicked on (if using a mouse ) or accessed using the "+"
  103. and "-" keys. The mutation rate is expressed as a percentage. ie there
  104. is a "mutation rate" percentage chance of a gene being mutated during
  105. translation from parent to child.
  106.  
  107. 4. Mode buttons, "N", "W" "D"
  108.     These buttons control the mode that Etree operates in. In
  109. "N"ormal mode, the plants are selected and breed together etc.
  110. "W"hich mode ,a single plant is selected. ie. "Which plant do I select ?"
  111. "D"raw mode, the previously selected plant (selected in "W"hich mode) os
  112. drawn starting at the center of the screen, the plant can then be moved
  113. around using the following keys :
  114.              up
  115.              8
  116.           left 4   6 right
  117.              2
  118.             down
  119.  Once positioned, the plant can be saved, or dumped out as a POVRAY
  120. scene file (NB these can get HUGE, files of over 2mb are not uncommon).
  121.  The modes progress from one to the other, so you can't go from "N"ormal
  122. mode to "D"raw mode, without first selecting "W"hich mode. "N"ormal mode
  123. can be returned to at any stage.
  124.  These buttons can either be clicked on (if using a mouse ) or accessed
  125. using the "n" "w" and "d" keys respectively.
  126.  
  127. 5. "Save" Button :
  128.     This button saves the currently displayed plants, as a PCX
  129. graphics file. The PCX's are labelled "ETREE001.PCX" "ETREE002.PCX" etc.
  130. The pictures are saved in the current directory, and can get quite large
  131. if you are using a large screen size. Besides being clicked on, this
  132. button can be accessed by pressing the "s" key.
  133.  
  134. 6. "Last" Button :
  135.     This enables the display to be restored to the previous display.
  136. Besides being clicked on, this button can be accessed by pressing the
  137. "l" or "*" keys.
  138.  
  139. 7. "Breed" Button :
  140.     This is the ( probably ) most important button in the program.
  141. By activating this button the selected plant(s) are breed together to
  142. produce the next generation. There must actually be some selected plants
  143. in order for this button to have any effect. So it will not work when
  144. the program is first executed. Besides being clicked on, this button can be
  145. accessed by pressing the "b" or "0" keys.
  146.  
  147. 8. "Reset" Button :
  148.     The most used button ! This button will generate a new random
  149. set of "seed" plants to use as a base for breeding. This button also
  150. resets the mutation rate back to its default ( 2.0% ). Besides being clicked
  151. on, this button can be accessed by pressing the "r" or "." keys.
  152.  
  153.              Onscreen Information.
  154.             ══════════════════════
  155.  From left to right on the screen the numbers are :
  156.  
  157. 1. Mutations.
  158.     This group of six numbers, represents the number of mutations
  159. that each member of the  current generation has undergone. the position
  160. of the numbers represents the position of the corresponding plant.
  161.  (ie. the upper left number represents the upper left plant. )
  162. These numbers are blank at first, as the newly seeded plants are "perfect".
  163.  
  164. 3. Generation Number.
  165.     This number shows the number of generations that have passed
  166. since the initial selections.
  167.  
  168. 3. Genetic Drift.
  169.     This number shows the totaled number of mutations for all the
  170. parents selected from the initial pair. So it "measures" how far
  171. ( genetically ) the current population has moved ( drifted )away from
  172. the original parents.
  173.  
  174.               General Operation.
  175.             ══════════════════════
  176.     Initially Etree will produce six random "seed" plants, any of these
  177. can be used as parents of future generations. If none of the plants have
  178. any visual appeal, then reset the seed plants by activating the "Reset"
  179. button (See above). Try activating the button several times, which will
  180. give you an idea of the types of images available. ( I'm still being
  181. surprised by the appearance of some plants. ) Once suitable parents have
  182. been selected, activate the "Breed" button ( see above ) to produce the
  183. next generation. Select the two "best looking" plants (or maybe just one
  184. plant selected twice ) from that generation and create another
  185. generation. By now the population should be relatively uniform in
  186. appearance, if you are sick of the current crop then just activate the
  187. "Reset" button, or if the basic direction that the plants are evolving
  188. in is OK but there isn't enough variation between generations then
  189. increase the Mutation Rate. (Note. This can have dramatic results..... )
  190.  
  191.                 POV output.
  192.             ══════════════════════
  193.  I don't know a great deal about POVRAY and so the images will need
  194. fine tuning after output. Try rotating them about the Z axis, as the
  195. images are "flat" (ie they lie in the x,y plane.). The plant is dumped
  196. as a CSG #declared as "Etree", which is made up of lots (and lots... )
  197. of cylinders, so these files can be HUGE if the plant is very "leafy".
  198. The POV file will be dumped as "Etree.inc", and will overwrite any other
  199. POV dumps with that name in the same directory.
  200.  I use the generated file like this : ( feel free to cut this out and use it ,
  201. or better yet , don't cut it out and send me the improved version that
  202. you use. )
  203.  
  204. /* Etree POV output.
  205.    All the #declared values are just examples, and probably will not
  206. give ideal results all the time, so change them at will.
  207.  
  208. */
  209. #include "colors.inc"
  210. #include "textures.inc"
  211. #include "shapes.inc"
  212.  
  213. #declare XSCALE = 9
  214. #declare YSCALE = 9
  215. #declare ZSCALE = 9
  216.  
  217. #declare XTRANS = .5
  218. #declare YTRANS = 0
  219. #declare ZTRANS = 0
  220. /* Must have these #declare's as Etree.inc uses them
  221.  
  222.  STEM_RAD   is the radius of the cylinders, that make up the stem.
  223.  BRANCH_RAD is the radius of the cylinders, that make up the branches.
  224.  LEAF_RAD   is the radius of the cylinders, that make up the leaves.
  225.  
  226. */
  227.  
  228. #declare STEM_RAD = 0.005
  229. #declare BRANCH_RAD = 0.003
  230. #declare LEAF_RAD = 0.002
  231.  
  232. object { light_source{ <-10,5,-10> color White } }
  233. camera {location <0,0,0>
  234.     look_at <0,0,1>
  235.     direction<0,0,1>
  236.     up <0,1,0>
  237.     right <1.3,0,0>
  238.     translate <0,0,-5>
  239.       }
  240.  
  241. #include "etree.inc"
  242. #object { Etree
  243.    rotate <0,0,clock *22.5>
  244.    translate<XTRANS,YTRANS,ZTRANS>
  245.    scale <XSCALE,YSCALE,ZSCALE>
  246. }
  247.  
  248.  
  249.                    Outro.
  250.             ══════════════════════
  251.    I would really appreciate any sugestions for improvements and/or
  252. bugfixes in this program, or in fact any comments in general (on the
  253. program ;-) ).
  254.  So mail any comments to :
  255.     ajs1@cs.waikato.ac.nz
  256.  
  257. Cheers,
  258.   Alex. J. Slater. 1995
  259.