When you start GGP, the program will show the three permanent dialogs
Data of the approximations.
When you start Actions or modify one of the Options, temporary dialogs pop up that allow you to modify data, answer questions, execute commands, etc. Not all of these dialogs are explained here. The most important ones are:
of a function
Data of the basis functions
Constants, elementary functions and operations
Fitness definitions and entire basis data
Function options dialog
Graphic window options
Mutation rates, Constants
Options for computations of series and formula
Pool of available basis functions
What would you like to be computed?
GGP Actions Contains 9 buttons that are a kind of shortcuts for the most important actions that can also be started from the Actions menu. Note that there are some differences in the behavior of the shortcuts and the menu actions. The shortcuts immediately start an action (usually), whereas the menu actions usually display dialog boxes for specifying details of the action. The meaning of the 9 buttons (from left to right) is:
Cursor position Displays the data of the position of the cursor, as long as it is in a CH Graphics window.
Data of the approximation Displays the most important data of the actual and best approximation that has been found so far. Moreover, a small text box gives hints on what GGP is doing.
Approximation of a function Contains the most important system parameters for the approximation of a given function. Note that the approximation is performed in three nested loops. The dialog contains a group of boxes for each of these loops. The inner loop is the parameter optimization loop, the middle loop is the type optimization loop, the outer (infinite) loop is the pool optimization loop. In addition, the dialog contains boxes for the color number and the CH Graphics window number to be used for drawing the actual approximation or error of the approximation, the maximum numbers of files to be used for saving basis functions and pools of basis functions, and - most important - the range xmin ... xmax for the approximation. Note that the actual function should be known in a range xmin' ...xmax' that should include xmin ... xmax. The range xmin ... xmax is used to compute the parameters and the error of the approximation, whereas the part of the range xmin' ...xmax' outside xmin ... xmax is used to compute the error of the extrapolation. For example, if one has xmin'=xmin=0, xmax=1, xmax'=2, the approximation is computed in the interval x=0...1, the extrapolation in the interval x=1...2. Standard series expansions (Fourier, power series, etc.) allow to obtain a small error of the approximation, but a large error of the extrapolation. If both errors are small, it is very likely, that the GGP approximation somehow contains the true solution! If both errors are 0.0001 or less, you can stop GGP, display and analyze the best solution that has been found. Of course, these statements are only true if the range of the extrapolation is sufficiently large.
The parameter optimization loop is repeated no more than N<= times. It can be exited before N iterations have been performed, if the chance of finding a much better solution is considered to be small. The values rel. loop exit and abs. loop exit define the exit conditions if you reduce these values, an exit becomes less likely. Since each basis function has exactly one non-linear parameter p0, the entire basis has as many parameters as basis functions. It is not necessary that all of them are modified at the same time. If you set Modif. 50 %, only half of them will be modified. It will be more likely that the parameters corresponding to functions with a low fitness will be modified. All parameters are within the parameter range min ... max.For the modification of the parameters, the Parameter variation formula is applied. You can modify this formula, if you have a better idea! Note that the parameter range and the variable pvar that is used in the Parameter variation formula can be dynamically modified by GGP. If you don't like this, check the box fix.
The type optimization loop is performed at least as many times as required to compute the fitness of each function in the pool once. GGP picks up pool functions with an undefined fitness and constructs a basis using them. This basis is tested in the parameter optimization loop. It is reasonable to test at least the fittest pool functions more than once. This is done, if N+= is bigger than 0. After having used each of the pool functions in one of the basis sets, GGP will construct N+= basis sets by picking up preferably pool functions with higher fitness. This considerably increases the chance of finding a basis set with a high fitness. Not that a basis set is characterized by the "entire basis fitness" and can contain several basis functions. Each of them has its own fitness. GGP can replace only a part of the functions of the set. If you set Mod 50 %, only half of them is replaced. Of course, those with the lowest fitness will be replaced with a higher probability. Since GGP can store useful sets of basis functions on files, it can pick basis functions not only out of the pool but also out of the files. Use basis files allows to define the corresponding rate.
optimization loop is
infinite and can be stopped by the user only and by rare events
that cause GGP to crash. In this loop, the Mod. %
worst basis functions of the pool are deleted and replaced by new
functions that are constructed A) randomly, B) by mini mutations
of one of the remaining functions in the pool, C) by the
well-known genetic operations mutation or crossover. The
corresponding rates are defined in the boxes Random,
Mini mutation, and Genetic.The
corresponding "subrates" can be viewed and modified by
pressing the Details button. Note that
GGP 'knows' several mini mutations, two types of genetic
operations, and "repair mutations". Each of the
functions is checked immediately after its generation (except if Check
is off). If one the function fails the "parameter dependence
check", a "repair mutation" attempts to obtain a
useful function by some mini mutations. Maybe, this is not what
nature does, but it is what an engineer does. GGP can construct
formula trees with an arbitrary depth and topology. The formula
are stored in character strings. These strings are limited in the
Demo Version to 100 characters only, which also reduces the
maximum Tree depth to a low value. For full
trees with binary operators, i.e., elementary functions with one
argument only (Christian Hafner's favorites), the maximum depth
allowed is 3. A typical string of depth 3 is:
In usual notation, this is ((x0/p0)*(p0*x0))*sin(cos(p0*p0)*(x0/x0)). You certainly can simplify this formula. Symbolic formula simplification is rather difficult. Moreover, simplification modifies the topology of the formula tree. The tree above has exactly 8 terminals. It is completely symmetric and has the same topology as all full trees of depth 3 with binary operators only. (x0*x0)*sin(cos(p0*p0)) has only four terminals, sin(cos(p0^2))*x0^2 even only two terminals and a completely different topology. This makes crossover not only more complicated but also questionable. Natural genetic crossover combines strings of identical length, not strings of arbitrary length. At least, Christian Hafner's experience with full trees without simplification is more encouraging than the experience with variable trees with simplification. Therefore, only full trees without automatic simplification are available in the current GGP implementation.
Data of the basis functions Contains the information on the actual basis and buttons for changing and recomputing the basis. Since the entire basis can contain more than one basis function, only the data of the basis function selected in the Actual # box are displayed, namely its Formula, its Amplitude, its nonlinear Parameter, and some additional information such as the best parameter that has been so far, the Number of calls of the basis function and fitness data. In order to modify the basis, you can use the Add, Delete, or Modify button. Before you touch one of these buttons, you should select its behavior in one of the three boxes below the button and you should modify the contents of the corresponding boxes if required. For example, if you would like to setup your own basis containing the functions sin(p*x) and cos(p*x), you proceed as follows: 1) Delete all basis functions by selecting all and pressing Delete afterwards. 2) Define the basis data, by typing "sim(p0,x0)" or - if you prefer - "sin(mul(p0,x0))" in the box containing the formula. Note that the index 0 is optional. Define the actual value of p0 in the Parameter box. 3) Add the basis by selecting this and pressing Add. 4) Repeat the steps 2) and 3) with "com" instead of "sim". Now, you can ask GGP to compute the appropriate amplitudes and the fitness values by pressing Recompute fitness. Maybe, GGP can find a better set of nonlinear parameters than you. Press Optimize to allow GGP to do that. Note that this optimization will be performed in an infinite loop that can only be stopped by you, when you press the Stop button or when you select Stop approximation. Note that GGP repeats Add and Delete until the number of basis functions is equal to the number in the define box. This is useful for setting up, for example, a basis with many random functions: 1) Delete the entire basis as indicated above. 2) Select the desired number of basis functions in the define box. 3) Select random and press Add. GGP can set up a Fourier type basis when you press Set Fourier Basis. Note that GGP can Optimize the nonlinear parameters, i.e., the Fourier frequencies. This results in non-orthogonal Fourier series that can be much more accurate than traditional Fourier series.
Constants, elementary functions and operations Contains the definitions of the four implicit constants C0, C1, C2, C3 and the probabilities of GGP's elementary functions/operators that are used to construct formula of basis functions. When the probability is set equal to 0, the corresponding function/operator will not be used when GGP constructs a new basis function. Nonetheless you can add manually formula in the pool containing elementary functions/operators with zero probability.
Fitness definitions and entire basis data Contains the formal definitions of the fitness values and some fitness information of the actual basis. Note that GGP uses the Entire basis fitness (society fitness) and the Combined fitness values (individual fitness within the society). The latter consists of the three parts 'Amplitude' fitness, 'Error' fitness, and 'Similarity' fitness, which are obtained from the analysis of the basis.
Function options dialog Contains data on the actual function and its graphic outfit. Note that GGP displays only one real-valued function with only one real-valued argument at a time, but GGP can store several functions of one or more arguments in a file. In this case, GGP stores all functions as an array. The rows of this array correspond to the values, i.e., the sampling points. The Number of values indicates how many are defined. Each column of the matrix contains either a function (an Y argument) or an argument of a function (an X argument). Although functions and arguments can make a difference for you, there is no difference for GGP. Thus, Number of arguments is equal to the number of functions and arguments, i.e., equal to the number of columns of the matrix. You define which row is the argument and which row is the function to be displayed by setting the corresponding row numbers in the boxes X argument number and Y argument number. Note that you can select the value 0 in these boxes. The argument number 0 is not explicitly stored. It is the number of the value, i.e., the number of the sampling point, i.e., the number of the row of the matrix. Both the X and Y argument have a title that is printed along the X and Y axis respectively. You can modify the title proposed in the boxes X argument title and Y argument title. GGP has three Styles for representing a function. Moreover, you can add three different Markers. Both, styles and markers have three attributes. The marker Size and the style Width are given in pixels. The Color number used for drawing is within the range 0...255 for graphic modes with 256 modes. The actual color depends on the palette you are using. If you set the marker color to -1, the same color number as for the style is used.
Graphic window options Contains data of the CH graphics windows. For the GGP Demo Version, the number of such windows is one and cannot be changed. Each window is characterized by 1) a Title, displayed on the top, 2) the Window size and borders, 3) the Window limits, and 4) some extras. In a CH graphics window, the functions are drawn in a rectangle of Width pixels in horizontal direction and Height pixels in vertical direction. On the Left, Right, Top, and Bottom sides of this rectangle, there is a border that is also specified in pixels. Note that the X argument title and Y argument title and the are drawn on the bottom border and the left border respectively, provided that the corresponding boxes in the Axis and Labels area are checked. For both, X Labels and Y Labels you can specify a number that indicates how many labels you would like to have. Depending on whether you select a logarithmic scale or not, the meaning of these numbers is different. Note that GGP always tries to draw something that looks nice, but this must fail in extreme situations, above all when you select logarithmic scale and GGP should display negative numbers. In addition to the window borders, you can also turn the X Axis and the Y Axis on. Moreover, you can set a grid that is usually invisible. This grid affects the display of the mouse position, but it is not important for GGP. Moreover, you can select Gray, Color, or Variable Palette. Note that not all graphic adapters and graphic drivers allow to set the palette. If the default background of your CH graphics window is black after starting GGP, the palette cannot be set. This makes the graphic outfit less nice and you probably better change the color numbers for the function, markers, errors, approximations, etc. because the default values might not be appropriate. The Window limits Xmin, Xmax, Ymin, Ymax indicate the range of the X and Y argument. Sometimes, you don't know appropriate values in advance. In this case, you can turn Auto set window limits on. When this box is checked, GGP will try to set the limits in such a way that the function and the labels look nice. For tricky cases, for example, for functions with sharp peeks, this might not be what you want, but it gives you a first idea.
Mutation rates, Constants Contains details of the GGP mutations that are not described here.
Options for computations of series and formula Contains data for defining several series and of user defined formula. The former is not important for the GGP demo and is not described in this manual. In the section User's formula, you can enter a formula using GGP's elementary functions and syntax. In addition to the formula itself, you have to specify the range of its arguments xmin= and xmax=, the nonlinear Parameter p=, and the number of values, i.e., of sampling points in the interval xmin...xmax. GGP can simplify the formula for you. Although GGP 'knows' only a few rules for doing that, it is useful to press Simplify now, because GGP will check first the syntax of the formula. GGP can also differentiate a formula, but this will only work when the formula is very simple because of the limited length of formula strings in the GGP Demo Version (maximum 100 characters). GGP computes the function defined by de user defined formula when you run the corresponding command from the actions menu, when you press the corresponding button of the GGP actions dialog box, or when you press the button OK, compute now!.... GGP will ask: "What would you like to be computed?" in a dialog, where you can press several keys.
Pool of available basis functions Contains data of the individuals in the pool and buttons for pool manipulations. The formula string of the individual selected in the Actual# box is displayed in the Function box. You can inspect all of the formula in the pool by pressing the button on the right hand side of this box. You can overwrite any of the pool functions and press Replace actual function by this. If you press Add this to the pool instead, a new basis function with the actual formula string is added. The actual individual can also be deleted by pressing Delete this from the pool. The pool size is displayed in the define(d) box. In most cases you do not like to setup the entire pool manually. Initialize the pool deletes all individuals and randomly adds as many as required in the define(d) box. When you increase the value in the define(d) box and press either Random add or Genetic add, GGP will automatically add individuals until the required number of individuals is in the pool. Note that Genetic add requires fitness data of the individuals that are not present in the beginning, when the individuals in the pool have not been used yet. When you decrease the value in the define(d) box and press Genetic delete, GGP will delete the worst individuals until the required number of individuals is in the pool. Again, this require the knowledge of the fitness values obtained in the infinite loop that optimizes the approximation of the given function. When all fitness values of the individuals are known, you might want to inspect the best ones in the pool. Note that the pool is not sorted with respect to the fitness. You can force sorting by pressing Sort. Since each individual can have used several times for the approximation of the given function, it has many fitness values that must be compressed into one value. GGP computes and stores both the average and the maximum fitness value of each individual. These two values are compressed by the formula Fitness def. to a single fitness value that is used for the genetic operations acting on the pool. The fitness data of all individuals are reset to unknown, when you press Reset pool to 'not yet used'.
What would you like to be computed? Contains buttons that allow the computation of several series and function manipulations. For the GGP demo, only User's formula is of interest. If you press this key, GGP will compute the function defined in the series and formula dialog that is opened when you select Series and formula from the Options menu. Note that this will destroy the data of the currently defined function. Therefore, GGP will ask you, if you like to Save functions first? When you answer in the affirmative, the usual Windows dialog for saving data on a file will be displayed.
Back to the Index