home *** CD-ROM | disk | FTP | other *** search
- ════════════════════════════════════════════
- Etree V2.02B 2/10/95
- Alex J Slater.
- ajs1@cs.waikato.ac.nz
- ════════════════════════════════════════════
-
- Copyright (C) 1995 by Alex J.Slater.
-
- Permission to use and distribute Etree for any purpose and without fee
- is hereby granted, provied that you don't make a profit from Etree directly.
- That is, you can use Etree for anything you like, and do what ever
- you want with the output, but you CAN'T sell Etree.
-
- For BBS and software distribution sites, a handling fee is allowed to be
- charged.
-
- This software is provided "as is" without express or implied warranty.
- The author is not responsible for any damage caused by this program.
-
- This program was written using DJGPP v2.0beta3, and version 2.0 of the
- GRX graphics library, which is :
- "Copyright (c) 1995 Csaba Biegl, 820 Stirrup Dr, Nashville, TN 37221"
-
- DJGPP and GRX are available for ftp from : ftp.idsoftware.com ,
- and various other ftp sites.
-
-
- Introduction.
- ══════════════════════
-
- Etree ( Evolving Trees ) is an artificial evolution program, that
- produces a series of "Child" trees from some parent tree(s),
- and display the results graphically.
-
- The tree's image is generated according to a series of parameters kept for
- each tree ( a "genetic" code ). Once suitable parents are selected, the
- program will use the codes (or code if the plant is to be breed with
- its self ) of the parent to derive the child trees in a way similar to
- organic reproduction.
-
- Each parent's code is split at a random point, and combined to form a
- new tree that contains characteristics from each parent. At the time
- the generation of new plants there is the possibility of the parameter being
- mutated, and so a code that didn't appear in either parent may appear in
- the child.
-
- The trees also can develop flowers, and these are slightly different
- than other features of the tree, as they are not constant. In that while
- the shape and colour of the flower is constant, there is a random
- element in their placement, so the same tree redrawn may have a
- different distribution of flowers.
-
- The Program.
- ══════════════════════
- Etree will work in any resolution with a horizontal resolution
- greater than or equal to 640, and a vertical resolution of at least
- 200. The higher the resolution you can run it in, the better.
-
- The screen is divided into two main areas:
- 1. The display area. (top part of the screen with a black background).
- This is where the results of the latest operation are displayed.
- 2. The information bar.(bottom part of the screen, with a grey background)
- This contains buttons, and readouts.
-
-
- The Display Area.
- ══════════════════════
- This is where the plants are drawn into. There are six plants drawn
- at a time.
-
- The Information Bar.
- ══════════════════════
- This is where the program is controlled from, and where the
- program displays information. The information bar has a number of
- "buttons" on it that affect the program in various ways, as well as a
- information on the current generation.
-
- Buttons:
- ══════════════════════
- From Left to Right (on the screen ) the buttons are :
-
- 1. Plant Selector Buttons :
- These are a group of six small buttons, that show which plant/plants
- are currently selected for breeding etc. The position of the buttons
- corresponds to the positions of the plants in the display area. So the
- top left plant selector button shows the status of the top left plant.
- Besides acting as an indicator of what's selected, the buttons also can
- be directly clicked if you are using a mouse, or by using the number keys on
- the keyboard to select the corresponding plant . The buttons correspond
- to these keys : (if you have a numeric keypad, use that ).
- 4 5 6
- 1 2 3
- 2. Draw Flowers Button :
- This is a 'toggle' button that controls wether or not flowers
- are to be drawn. Note: The flowers are still generated and mutated, just
- not drawn.
-
- 3. Mutation Rate Buttons :
- These are two buttons, one on either side of the mutation rate
- display. The button marked with the '+' sign increases the mutation rate
- while the button marked '-' decreases the mutation rate. Both buttons
- can either be clicked on (if using a mouse ) or accessed using the "+"
- and "-" keys. The mutation rate is expressed as a percentage. ie there
- is a "mutation rate" percentage chance of a gene being mutated during
- translation from parent to child.
-
- 4. Mode buttons, "N", "W" "D"
- These buttons control the mode that Etree operates in. In
- "N"ormal mode, the plants are selected and breed together etc.
- "W"hich mode ,a single plant is selected. ie. "Which plant do I select ?"
- "D"raw mode, the previously selected plant (selected in "W"hich mode) os
- drawn starting at the center of the screen, the plant can then be moved
- around using the following keys :
- up
- 8
- left 4 6 right
- 2
- down
- Once positioned, the plant can be saved, or dumped out as a POVRAY
- scene file (NB these can get HUGE, files of over 2mb are not uncommon).
- The modes progress from one to the other, so you can't go from "N"ormal
- mode to "D"raw mode, without first selecting "W"hich mode. "N"ormal mode
- can be returned to at any stage.
- These buttons can either be clicked on (if using a mouse ) or accessed
- using the "n" "w" and "d" keys respectively.
-
- 5. "Save" Button :
- This button saves the currently displayed plants, as a PCX
- graphics file. The PCX's are labelled "ETREE001.PCX" "ETREE002.PCX" etc.
- The pictures are saved in the current directory, and can get quite large
- if you are using a large screen size. Besides being clicked on, this
- button can be accessed by pressing the "s" key.
-
- 6. "Last" Button :
- This enables the display to be restored to the previous display.
- Besides being clicked on, this button can be accessed by pressing the
- "l" or "*" keys.
-
- 7. "Breed" Button :
- This is the ( probably ) most important button in the program.
- By activating this button the selected plant(s) are breed together to
- produce the next generation. There must actually be some selected plants
- in order for this button to have any effect. So it will not work when
- the program is first executed. Besides being clicked on, this button can be
- accessed by pressing the "b" or "0" keys.
-
- 8. "Reset" Button :
- The most used button ! This button will generate a new random
- set of "seed" plants to use as a base for breeding. This button also
- resets the mutation rate back to its default ( 2.0% ). Besides being clicked
- on, this button can be accessed by pressing the "r" or "." keys.
-
- Onscreen Information.
- ══════════════════════
- From left to right on the screen the numbers are :
-
- 1. Mutations.
- This group of six numbers, represents the number of mutations
- that each member of the current generation has undergone. the position
- of the numbers represents the position of the corresponding plant.
- (ie. the upper left number represents the upper left plant. )
- These numbers are blank at first, as the newly seeded plants are "perfect".
-
- 3. Generation Number.
- This number shows the number of generations that have passed
- since the initial selections.
-
- 3. Genetic Drift.
- This number shows the totaled number of mutations for all the
- parents selected from the initial pair. So it "measures" how far
- ( genetically ) the current population has moved ( drifted )away from
- the original parents.
-
- General Operation.
- ══════════════════════
- Initially Etree will produce six random "seed" plants, any of these
- can be used as parents of future generations. If none of the plants have
- any visual appeal, then reset the seed plants by activating the "Reset"
- button (See above). Try activating the button several times, which will
- give you an idea of the types of images available. ( I'm still being
- surprised by the appearance of some plants. ) Once suitable parents have
- been selected, activate the "Breed" button ( see above ) to produce the
- next generation. Select the two "best looking" plants (or maybe just one
- plant selected twice ) from that generation and create another
- generation. By now the population should be relatively uniform in
- appearance, if you are sick of the current crop then just activate the
- "Reset" button, or if the basic direction that the plants are evolving
- in is OK but there isn't enough variation between generations then
- increase the Mutation Rate. (Note. This can have dramatic results..... )
-
- POV output.
- ══════════════════════
- I don't know a great deal about POVRAY and so the images will need
- fine tuning after output. Try rotating them about the Z axis, as the
- images are "flat" (ie they lie in the x,y plane.). The plant is dumped
- as a CSG #declared as "Etree", which is made up of lots (and lots... )
- of cylinders, so these files can be HUGE if the plant is very "leafy".
- The POV file will be dumped as "Etree.inc", and will overwrite any other
- POV dumps with that name in the same directory.
- I use the generated file like this : ( feel free to cut this out and use it ,
- or better yet , don't cut it out and send me the improved version that
- you use. )
-
- /* Etree POV output.
- All the #declared values are just examples, and probably will not
- give ideal results all the time, so change them at will.
-
- */
- #include "colors.inc"
- #include "textures.inc"
- #include "shapes.inc"
-
- #declare XSCALE = 9
- #declare YSCALE = 9
- #declare ZSCALE = 9
-
- #declare XTRANS = .5
- #declare YTRANS = 0
- #declare ZTRANS = 0
- /* Must have these #declare's as Etree.inc uses them
-
- STEM_RAD is the radius of the cylinders, that make up the stem.
- BRANCH_RAD is the radius of the cylinders, that make up the branches.
- LEAF_RAD is the radius of the cylinders, that make up the leaves.
-
- */
-
- #declare STEM_RAD = 0.005
- #declare BRANCH_RAD = 0.003
- #declare LEAF_RAD = 0.002
-
- object { light_source{ <-10,5,-10> color White } }
- camera {location <0,0,0>
- look_at <0,0,1>
- direction<0,0,1>
- up <0,1,0>
- right <1.3,0,0>
- translate <0,0,-5>
- }
-
- #include "etree.inc"
- #object { Etree
- rotate <0,0,clock *22.5>
- translate<XTRANS,YTRANS,ZTRANS>
- scale <XSCALE,YSCALE,ZSCALE>
- }
-
-
- Outro.
- ══════════════════════
- I would really appreciate any sugestions for improvements and/or
- bugfixes in this program, or in fact any comments in general (on the
- program ;-) ).
- So mail any comments to :
- ajs1@cs.waikato.ac.nz
-
- Cheers,
- Alex. J. Slater. 1995
-