After downloading ego.exe, you should be able to immediately run the excutable. The first time it is run it will create a subdirectory of whatever directory it was run from called 0. The first thing you should do is create some random programs. You do this by choosing Open from the File menu. Enter the path of any directory to store your programs in. If you choose ".", then the programs will be put in the recently created 0 directory. Otherwise, a subdirectory called 0 will be created for whatever path you enter. You can then create and modify programs in the edit window (note that the interpreter is case sensitive so follow the GOLLL specification exactly). To begin evolution, you can choose Evolve from the File menu or press F1. This takes you from the initial generation to the next generation. You can rank the programs using the Increment, Set Ranking, and Decrement buttons and view them using View or by double clicking. A program's ranking corresponds to its fitness and is therefore very important in the evolution process. Every time you press F1 or select Evolve from the File menu, the next generation will be created.
By selecting Settings from the Edit menu, you can modify how the evolution works. The simplest choice you can make is whether to generate color patterns, parametric curves, or both. The default is both. Change this by checking and unchecking the boxes marked IncludeDrawXY statements and IncludeColorXY statements. The other settings are more complicated and are explained below. All values should be positive integers unless otherwise noted.
|Whenever the next generation is computed, these settings determine how many of the programs in the new generation result from mutation, crossovers, survival, and new random programs. For each of the four categories, the weight divided by the sum of the four weights determines the fraction of programs from that category|
|Survival from Top Weight
Survival from Rest Weight
|Among programs survive from one generation to next, some will come from the best fit programs (the top) and others from less fit programs (the rest). These two values give the ratio of survivors from the top to surviviors from the rest.|
|Mutation from Top Weight
Mutation from Rest Weight
|Among programs that are the result of mutation, some will have well fit parents and others will have less fit parents. These two values give the ratio of parents from the top to parents from the rest.|
|Crossover from Top Weight
Crossover from Rest Weight
|Among programs that are the result of a crossover, some will have well fit parents and others will have less fit parents. These two values give the ratio of parents from the top to parents from the rest.|
|% of Programs in Top||This value defines what the top means for the other values. It is the percentage of programs considered to be in the top.|
Usually, the top is smaller than the rest since you want a small number of the best programs to have a large amount of influence on the next generation. We usually defined the top as the best 20% of the programs. We also gave the "Top" Weights higher values than the "Rest" Weights. In the spirit of evolution (as opposed to guessing), the value for New Weight (corresponding to the number of completely random programs created each generation) should be small.
Note that the word "Average" in all of the following is somewhat misleading. The values you supply will usually not be actual averages of the settings in question, but rather they will affect those settings (i.e. the higher "Average Depth" setting is, the higher the depth of the generated program is likely to be).
Random Program Generation Settings:
|Average Depth||Affects the depth of subexpressions in the randomly generated programs|
|Average # of DrawXY||How many DrawXY statements you want in the generated programs (put -1 if you want exactly 1 DrawXY per program)|
|Average # of Variables||How many DefVar statements you want in the generated programs (put -1 if you want exactly 1 variable per program so all DrawXY use it)|
|Include DrawXY statements||Check this if you wish to have DrawXY statements in your program (uncheck it if you want color patterns only)|
|Include ColorXY statements||Check this if you wish to have 1 ColorXY statement in your program (uncheck it if you want curves only)|
|Trig Functions Weight,
Arithmetic Functions Weight,
Exponential Functions Weight
|Determines the likelyhood of certain functions appearing in the random programs. If, for example, you set Trig to 40, Arithmetic to 60, and Exponential to 10,
then your programs will contain the functions in those families in 4:6:1 ratio.|
Trig family of functions includes SIN, COS, TAN.
Arithmetic includes +, -, *, /, %.
Exponential includes ^, LOG, HSIN, HCOS, HTAN.
|"Special" Constants Weight,
Random Constants Weight,
|Determines the likelyhood of constants and variables appearing in the random programs. If, for example, you set Special to 5, Random to 35, and Variable to 60,
Then the "simple" arguments (as opposed to subexpressions) to the your programs will contain 5% special constants, 35% random constants, and 60% variables ("t" and "u").|
Speical constants include (all +/-) 1.0, 2.0, 2.71 and probably shouldn't be used much.
Random constants (all +/-) average 1.0, but can be significantly smaller and larger than that.
Variables will always be "t" for DrawXY and "t" or "u" for ColorXY.
|Average Depth||Affects the depth of the expression in which mutation will take place. If this depth exceeds the actual depth of the expression, it is likely that the mutation takes place at the lowest level in the expression. Note that the subexpression selected for mutation may not be the deepest one in the whole expression.|
|Average # in DrawXY||How many mutations will take place in DrawXY statements every time a program is selected from mutation (-1 if exactly one mutation is desired)|
|Average # in ColorXY||How many mutations will take place in ColorXY statement every time a program is selected from mutation (-1 if exactly one mutation is desired)|
|Constant To Constant Weight,
Constant to Variable Weight,
Constant to Expression Weight
|Determines the likelyhood of a constant mutating to something else. All operands at a given depth have equally good chance of being chosen for mutation. This setting will only be invoked if the operand happens to be a constant. Note that if, in general, you wish your programs to grow you should set Constant To Expression Weight high since this increases the likelyhood of substituting a subexpression for a constant, thus increasing complexity of the program.|
|CC New Weight,
CC Change Weight
|Determines what happens if a Constant-to-Constant mutation is taking place. We can either create a new constant from scratch or slightly increase or decrese the existing constant. CC New corresponds to the first option, CC Change to the second. This setting is only used if we are doing a Constant-to-Constant mutation; it has no effect on anything else.|
|Variable To Constant Weight,
Variable to Variable Weight,
Variable to Expression Weight
|Determines the likelyhood of a variable ("t" or "u") mutating to something else. All operands at a given depth have equally good chance of being chosen for mutation. This setting will only be invoked if the operand happens to be a variable. Note that if, in general, you wish your programs to grow you should set Variable To Expression Weight high since this increases the likelyhood of substituting a subexpression for a constant, thus increasing complexity of the program. You most likely do not want to set Variable To Constant high since that will reduce the complexity of the program.|
|Expression To Constant Weight,
Expression to Variable Weight,
Expression to Expression Weight
|Determines the likelyhood of an expression (or subexpression, to be exact) mutating to something else. All operands at a given depth have equally good chance of being chosen for mutation. This setting will only be invoked if the operand happens to be a subexpression. Note that if, in general, you wish your programs to grow you should set Expression To Expression Weight high. You most likely do not want to set Expression To Constant and Expression To Variable high since that will reduce the complexity of the program.|
|First Average Depth||This is the depth into an expression in the first parent from which the code to swap is taken.|
|Second Average Depth||This is the depth into an expression in the second parent from which the code to swap is taken.|
|Average # in DrawXY||This is the number of crossovers to do between two parents within DrawXY statements. If you use -1, then exactly one crossover is done.|
|Average # in ColorXY||This is the number of crossovers to do between two parents within ColorXY statements. If you use -1, then exactly one crossover is done.|
If you want to try the curve fit problem, there are a few things that work differently from the discussion above. First of all, before you do anything else (including creating the random programs), you must choose Curve Fit Settings from the Edit menu. You can then enter as many points (more than one) as you want. These points define the curve fit problem. After you have entered the points, everything else should work the same. Note that some parameters from the dialog box discussed in the previous section are ignored since they are not applicable to this problem. Specifically, the number of ColorXY statements is forced to zero and the number of DrawXY statements is forced to one so all parameters affecting the number of these two kinds of statements are ignored. Since the curve fit problem uses a pre-defined function to determine the fitness of programs, the use of the Increment, Decrement, and Set Ranking buttons is ignored. After each generation is created, EGO sorts the the programs in the window by their computed fitness. To get the computed fitness value of a selected program, click the Get Fitness button.
When soloving the curve fit problem, EGO scales the graphics window based on the input points rather than based on the points on the curve. This means that some curves (really bad ones) may not appear in the window at all. The input points will appear as red circles in the graphics window.