Genie Manual Introduction The terms impact and growth are somewhat interchangeable, with impact tending towards the immediate sense of a single period, and growth being more of a cumulative value, e.g. over several periods of a simulation or whatever. Also growth doesnÕt necessarily imply increase, it can be negative. The term Cross Impact is usually used in the sense of the factor in question as being dependent upon another factor, and the cross impact being the effect of the latter upon the former. A model is a model, a graph is a graph, and a population is the set of genes, and their associated parameters being employed in a Genetic Search, which is what the whole exercise is for. Structure of a Model What is a model? The foundation of the model is the factors represented by the Model Window (every thing not evident here will be explained below). A factor is a name, some values, some connections and a set of attributes. The primary value of a factor is its self impact, the rate at which the factor will grow each simulation period, if unrestrained/encouraged. Another value is its start value. This is the initial value assigned in the first period of the simulation. A more important value, which only a few factors will use, is the target value. This is the desired result for the factor at the end of the simulation. This forms the objective function for the search procedure. A factor has the following set of attributes: Controllable: Is the factor part of the solution for the search procedure? Delayed Impact: If the factor is active only for a subset of the simulation time. Bounds: Limits on the total growth of a factor. Thresholds: The impact values which can influence a factor. Impacts less than the lower threshold have no effect, and impacts greater than the upper threshold are limited. Mainly used for cross impacts System Shocks: Exceptional growths for specific periods. Graphs: If the factors growth during the simulation is graphed. Cross Impacts: The proportion of another factors growth in a period which caused a growth in the specified factor. Delayed Cross Impacts: When the growth of a factor for a period is carried over to the next period. This is mainly useful if a factor has a zero self impact, but benefits from cross impacts form other factors. This enables other dependent factors to in turn benefit from the cross growths in this factorÉ understand? The model, apart from being the sum of the factors, contains a few bits of other information, mostly to do with default values for new factors, but also some global flags. Specifically, bounds, thresholds and system shocks can be turned off, and also cross impacts can be forced to delayed or immediate if desired. A Simulation A simulation is the self impacts and cross impacts being exercised over a specified number of periods. Given the nature of cross impacts, recursive cross impacts and the discrete nature of simulation time in particular, it wouldnÕt be a good idea to get too picky over whether a particular event occurs in, say, period 9 or period 10. Some things get delayed for a period, but over a number of periods, it all works out. The simulation save the cumulative growths for each factor for each period, which can later be graphed or saved for further analysis. Old simulation results which have been saved cannot be used again by Genie. Graphs Factors which have the graph attribute set are graphed at the end of each simulation run. The graphs are displayed in a reduced form in the Graph Browser window, and can be viewed at full size if desired. The graphs are useful for setting target values for searching, and also for comparing growths. Populations A population is a collection of genes, and information as to how to manipulate them. Some of this information is local to each gene, or even to the chromosomes within the genes, and some is universal to the population. The details are discussed below in ÔPopulation WindowsÕ. Populations are attached to and saved with a model. A population cannot migrate across models. Many populations can be attached to one model. The Menus File Menu  New Model/ Open Model: These are only active when no model is currently open. They do exactly what they say the do. Close: This will close the topmost window. If the window is a Model or Population window and is in need of saving, a prompt will be issued. Closing the model window closes all other windows as well. Save: Saves the topmost window. This is only applicable to Model and Population windows. Save As: This is the main avenue for save text representations of models and populations, it also performs the more mundane task of copying models and populations. See the detailed ÔSave AsÕ, below. Populations: This is only active when a model is open. The top half of the submenu deals with creating and managing existing populations. The items are: New Population: Creates, but doesnÕt save, an new Population window, with default settings. Rename Population: See ÔPopulation WindowsÕ, below. Delete Population: See ÔPopulation WindowsÕ, below. The bottom half of the menu lists existing populations; those saved with the model, and those created, and still existing, in the current session. Selecting one of these opens and/or brings the window to the front. Quit: Prompts the user to save unsaved windows, sounds taps, brushes its teeth and goes to bed. What do you think it supposed to do? Save As Menu Item As mentioned, this command does quite a lot. Its function is different for each window. For all windows excepting population windows, a modified Standard Put File dialog is presented. A pop up menu with the different save options appears alongside the prompt. For a fuller explanation of the windows, see the respective sections below. Model Window:  Two options exist for model windows. Genie File copies the current window to a new file and this becomes the current window. Changes made since the last save are not saved with the old file. Text File save a text description of the model. This is not reusable by Genie. Graph Browser:  PICT saves the complete window in, you guessed it, ÔPICTÕ format. Text Data save the results from the most recent simulation in a tab delimited text file. Graph Window: Same options as for Graph Browser, but only saves either the graph picture, or the data for the factor it represents. Population Window  Clone Population creates a copy of the Population window. Save As Text writes all the population and search parameters followed by any existing chromosomes, as a text file. Search Statistics saves the best, worst and average fitnesess for each generation of the most recent search in a tab delimited text file. Edit Menu The edit menu doesnÕt really get used much. The Graph and Graph Browser windows can be copied to the clipboard with it, and, if the Graph Browser is the topmost window, ÔSelect AllÕ will select all the cells, but beyond that, not much. Window Menu  This menu lists all the current windows. Items beneath the dimmed ÔGraphsÕ are, of course, graph. The first item is the model and beneath that are any open population windows. The Windows Model Window The foundation of any Genie session is the model window. There can be many windows open, but only one model window can be open at any time.  Factors List There are two lists in the model window. The left list is the factors currently defined for the model. The factor name is in the centre. To the left of the factor name are attribute flags. The symbols are as follows:  Hammer - Factor forms part of the solution during searching;  Clock - Cross impacts carried over to next period during simulation;  Target - Factor is a search target;  Graph - Factor produces graph after simulation;  Link - Factor is affected by other factors. The rightmost number displays the value indicated by the pop-up menu above the list.  Self Impact: The growth value applied each period during the simulation. ÔVariÕ means that the growth value is defined by the ÔVariGrowthÕ factor attribute. Search Values: The self impacts derived from the search process. These values are set from the search window. If ÔSearch ValuesÕ is selected, then a simulation will use these values instead of defined self impacts during simulation. If the factor is not active in the search, no value is displayed. Start Value: An arbitrary starting value. Active Targets: This is the target value for the factors defined as current search targets. If the factor is not a current search target, no value is displayed. All Targets: The target value of the factor, if it were to be declared as a current search target. Changing this value includes the factor as a current search target. The two text fields above the factors list are for changing the factor name and displayed value. The tab key changes between the fields, as will clicking on the field. Clicking on a factor selects that factor for editing. When an existing factor is selected, the value field is made active. Only the factor name and value can be edited directly in the window. Double clicking on a factor brings up the ÔCross ImpactsÕ dialog box, as explained below. Cross Impacts List This is a hierarchical list of the factors that influence the factor selected in the Factors List through cross impacts. Indented entries indicate the hierarchy. The format of the list is similar to the Factors List, with a few exceptions. There are only two symbols displayed, the  symbol, if the factor is in turn subject to cross impacts, and the  symbol, when the factors cross impacts are recursive. The value is the cross impact. Only the values for the top level factors are listed. Double Clicking on a factor in this list causes the factors that influence it to be listed, indented. If a factor is free from cross impacts, nothing will occur (aside from a chastising beep, perhaps). Double Clicking again on the factor will cause the sub factors to disappear. The length of the lists is pinned the the window size. As the window gets longer, so do the lists. If the window is reduced in size so as to partly cover one of the scroll bars, the scroll bar will disappear, meaning that if you want to scroll the list, you must drag with the mouse. There is a good reason for this. Model Menu  This is the menu associated with the model window. New Factor: Unsurprisingly, this creates a new factor, if the maximum number of factors is not exceeded, that is. The factor is given a default name and attributes. See ÔLimits and DefaultsÕ below. Remove Factor: The factor, and all references to it are deleted. Reset Factor: The factor is restored to its default values and attributes, and all cross impacts are removed. Cross Impacts: See ÔCross Impacts DialogÕ below. Factor Attributes: See ÔFactor Attributes DialogÕ below. Model Preferences: See ÔModel Preferences DialogÕ below. Go: If all the prerequisites are in order (i.e. factors exist) then the simulation is run for the number of periods defined in the Model Preferences Dialog. The results of the simulation can be saved as a tab delimited text file from the ÔGraph BrowserÕ window which saves all factors or individual ÔGraphÕ windows, which saves only the data for the factor shown. See ÔSave AsÕ menu item above. Cross Impacts Dialog  The cross impacts are set through this dialog box. In the left hand list are the available factors, and the right hand list the factors already defined as cross impacts. A subset of attribute symbols appears in both lists. To add a cross impact, select a factor from the list of available factors, and click the ÔAddÕ button, or alternatively, double click the item. To remove a factor, select an item in the ÔCurrent LinksÕ list, and click the ÔRemoveÕ button, or double click the item. Use the ÔCross ImpactÕ text field to enter the value of the impact. Zero values imply no impact, and the factor will not be included as a cross impact when the dialog box is closed. The ÔCross ProcessingÕ radio button determine whether the Cross Impact growths are carried across to the next period or not. Factor Attributes Dialog  Most of a factors attributes are set from here. The dialog is largely self explanatory. The pop-up menu for growth type looks like this:  The currently selected growth type is displayed in the dialog. A little more difficult is setting the limits.  The check box turns the selected limit on or off, and the boxes show the bounds. Active limits are checked in the menu. An asterix Ô*Õ in a text field indicates that the default value is to be used, usually +/- infinity. The system shocks list specifies a limited number of special shocks to apply during a simulation. Periods with shocks are displayed in outlined text, along with the shock value. To set a shock, select the desired periods, and enter a shock value in the text field below the list. To clear shocks, select the periods, and click the ÔClearÕ button. If VariGrowths are set, then the button ÔGrowth CurveÕ becomes active. Clicking on this button allows the definition of variable self impacts. If the factor has not previously had VariGrowths defined, then this dialog will appear first:  The lower and upper bounds are possible limits of the self impacts. The VariGrowths dialog looks like:  Points can be defined within the range by clicking. The first and last points are always tied to the first and last period, and can not be deleted. Clicking within a point removes it, and clicking at a different growth value on the same period as another point repositions it. This can get a bit tricky when the number of iterations is large, as one pixel may cover several periods, so donÕt be too exacting about where your points go. The ÔReset BoundsÕ button brings up the bounds dialog box. If the bounds are changed, the points already defined are scaled to the new bounds. This is also true for the iterations. If the number of iterations is later changed, the points are scaled to fit. Model Preferences Dialog  This dialog sets the model defaults and parameters. The ÔIterationsÕ field is the number of periods in a simulation. The ÔDisplay PrecisionÕ sets the number of decimal places used in the various outputs. ÔDefault Start Val.Õ is the value that new factors use for their starting values. The check boxes are global enable/disable switches. When checked, factors can use the respective attribute if it has been previously set. When unchecked, the attribute is blocked. The names are self explanatory. ÔDefault Growth TypeÕ refers to the growth type for new factors, and works the same way as the pop up menu in the ÔFactor AttributesÕ dialog (see above). Forced cross growths is another global switch. The options are:  ÔNoneÕ is the default option, and factors are allowed to carry over their cross impacts as set in the ÔCross ImpactsÕ dialog above. If ÔImmediateÕ is selected, then no cross impacts are carried over. If ÔDelayedÕ is selected, all cross impacts are carried over to the next period. Graph Browser Window  This window presents the graphs from the last simulation run in a reduced form. The window is actually a list and can be manipulated as such. To open the full size graph, double click it. It is possible to rescale the graphs from the Graph Browser window, using the ÔGraphsÕ Menu.  Rescale Graph: A dialog is brought up asking the user for new scale bounds. Only the growth scale can be changed. Data points outside of the new bounds are not shown. If more than one graph is selected then all are scaled to the new bounds. Auto Scale: The selected graphs are scaled to the maximum and minimum of the data. If more than one graph is selected, the user is asked whether to scale all graphs alike, in which case the maximum and minimum are derived from the data for the selected graphs (factors), or to scale the graphs independently. The ÔGraph BrowserÕ window is updated after each simulation run. The window can be copied to the clipboard or saved to a file. It is possible to save the window in a ÔPICTÕ file, or to save the data (all of it) in a tab delimited text file. See ÔSave AsÕ above. Graph Window  This is the full sized representation of a factors behaviour during a simulation run. The same scaling options as in the ÔGraph BrowserÕ are applicable: Rescale and Auto Scale. This window can be copied to the clipboard. It is also possible to save the graph as a ÔPICTÕ image, or to save the data represented by the graph. See ÔSave AsÕ above. What can be done in this window, however, is the setting of target values. There is a roving coordinate to the right of the graph. When the cursor approaches the right boundary of the graph, this becomes hilighted. Clicking now will set the target value to the y value in the coordinate. An new grey curve will appear. The new curve has the same origin as the original curve, and terminates at the target. What happens in between is not particularly important and should be taken as a serious expectation of factor behaviour. If the factor is not already an active target, the target value can be changed by selecting a new value. If the cursor enters the small target box, it becomes hilighted. Clicking in this box removes the target. Population Window Population Structure Simply put: A population consists of chromosomes; chromosomes are made up of genes and genes are constituted of allele. Now to work back up the scale. Each allele is represented by a bit and a string of bits forms a gene. Currently the maximum length of a gene is 28 allele, which is ridiculously accurate.This comes about more because its convenient to store these things as LongInts (32 bits, the Integer type is 16 bits, which may not be sufficient for all eventualities). What happened to the last 4 bits? TheyÕre being reserved for later fancy stuff like switching factors on and off, etc. The number of allele may change later. A chromosome is made up of these genes and also some information specific to the chromosome. Each chromosome is given an unique ID number. The IDÕs of its parent are stored in the chromosome, which could be useful for tracing ancestry. The chromosome also stores its own fitness value. At the population level is the phenotype template. This essential to the interpretation of the genes. For each gene is stored: The associated factor from the model; The range of values that the gene can represent; The resolution of the gene (number of allele); The coding method; The mating method. Currently there is only the binary range coding available. Mating methods available at the moment are one site or two site splices. Pretty ordinary, but then we evolved from the primeval sludge, so thereÕs hope yet. Also at the population level is the selection technique. Young hopefuls are selected by one of the following: Roulette - Random selection weighted towards fitter chromosomes; Random - Straight random selection Fit / Fit - With the population sorted by fitness, successively fit chromosomes are selected. Fit goes with fit, weak goes with weak; Ôand like shall go with likeÉÕ Fit / Weak - The fittest chromosome mates with the weakest, the next fittest with the next weakest, etc. Available replacement schema: Weak Parent - If the child is fitter than the parent, the parent is replaced; Both Parent - Both parents are replaced by the children; Weakest Gene - The weakest chromosome in the population gets it; Random - A randomly selected chromosome is replaced by the child. Convergence Schema: Fitness Sum - Converged if the sum of the finesses over the population falls below the convergence criteria; Average Fitness - When the population average falls below the criteria; Best Gene - When the chromosome of best fit is under the criteria; Worst Gene - When the worst chromosome is under the criteria. The Population Window  Above is the full sized population window. Two sizes are available, half size, which displays only the statistics for the current generation, and full size, which displays a running graph of best fit, worst fit and average fit up to the current generation. The top half of the window is self explanatory. The oval in the centre is a progress indicator, and the status box underneath the oval shows one of the following: Stopped - No search in progress. Seeding - The seed population is being generated. the indicator show the progress of the seeding operation. Searching - A search is in progress. The indicator displays the proportion of the maximum generations completed. Paused - The search has been suspended, and is able to be restarted if desired. This gives the an opportunity to modify some non critical parameters (see ÔPopulation LimitsÕ, below). Clicking on this  icon switches back to the half window. It is replaced by another icon which when clicked upon, restores the graph. The graph is a running graph of the current search. Since the domain of the solution space is unknown, and more to the point, some of the bad fits are really bad, it is necessary to be able to rescale the graph. Zooming in on a portion of the graph is accomplished by click-dragging a rectangle over the desired area. The boundaries of the rectangle will become the new graph. Going the other direction, or being more precise is achieved by this box: . Clicking on Rescale resales the entire graph to the global minima and maxima. Clicking x brings up the graph bounds dialog, similar to the ÔVariGrowth BoundsÕ box above. Any value between one and the maximum number of generations may be entered. Clicking y also brings up the bounds box, and any value between zero and infinity may be entered. A text copy of the population parameters, and existing chromosomes or the search statistics can be obtained through the ÔSave AsÕ menu item in the file menu, discussed above. The Genetic Menu  This menu is associated with population windows. Reset Parameters: Reinitialises the population and search parameters to the default settings. Population Parameters: See ÔPopulation ParametersÕ, below. Meet The People: To view the population, kiss babies, open hospitals, etc. See ÔMeet The PeopleÕ below. Go: This starts a genetic search. If a previous search has been suspended, or, the exists a population, the the user is asked if they wish the population to be reinitialised. In the case of a suspended search, not reinitialising continues on from the last generation. With a population left over from a completed search, not reinitialising uses the old population as the seed population. Reinitialising clears the population and resets the statistics. Population Limits Dialog  All the parameters for a population and search are contained here. This dialog may be accessed while a search is suspended, but changing some of the parameters will cause the population to be cleared. These are: Population Max; Selection Criteria; Phenotype Parameters. The various option for the selection,replacement and convergence criteria have been discussed above in ÔStructure of a PopulationÕ. The list box, and the fields below it are concerned with the phenotype parameters. The values in the edit fields are for the selected line in the list, and changing these effects a change in the list. Meet The People Dialog  Here is where we get a more detailed look at the population behind the search. The upper box presents the surviving chromosomes, with their immediate parentage and fitness. Selecting a chromosome puts its gene values into the lower box. Clicking Set Model writes these values into the ÔSearch ValuesÕ field of the model. It is then possible to run the model with these values and analyse the effects of the changes more completely. If Fit/Fit or Fit/Weak chromosome selection was employed, the list will be sorted on fitness, otherwise, it is unsorted (sorry). A text copy of the list can be obtained through the ÔSave AsÕ menu item, discussed above. Defaults And Limits Model Maximum Factors: 100 Factor Name Length: 20 Default Start Value: 1.0 Maximum System Shocks: 12 (per factor) Maximum VariGrowth Points: 12 (incl. ends) Maximum Simulation Periods: 100 Default Periods 20 Maximum Graphs: 50 Populations Maximum Population Size: 100 Default Size: 100 Minimum Population Size: 10 Maximum Genes: 10 Maximum Resolution: 30 Default Resolution: 8 Self Impact Range: -1.0 .. 1.0 Maximum Targets: 10 Maximum Generations: 500 Default Generations: 50