úΨð£“N      !"#$%&'()*+,-./0123456789:;<=>?@ABCDE F G H I J K L M FThe Rates structure is used to hold the probability of various events : occurring during the evolution of the GEP algorithm. /Probability of any single symbol being mutated  per individual *Probability of an individual experiencing $ insertion sequence transposition *Probability of an individual experiencing ) root insertion sequence transposition *Probability of an individual experiencing  gene transposition )Probability of a 1pt recombination event )Probability of a 2pt recombination event *Probability of a gene recombination event EThe SimParams structure reprents the parameters for a run of the GEP G algorithm. This includes gross parameters unrelated to individuals E such as the population size, parameters related to selection, and 5 parameters related to specific genetic operators. Population size #Exponent for defining the roulette  wheel bin sizes  Fitness of the ideal individual !Number of generations to run the  algorithm for Parameter m for fitness value # computation from the GEP paper. 'Maximum length of an IS transpose seq. (Maximum length of an RIS transpose seq.       EGenerate a random number as a Double between 0.0 and the given upper  bound.  Upper bound. EGenerate a random integer between 1 and the upper bound (inclusive).  Upper bound. $Generate a list of random integers. Number of integers to generate Upper bound for each integer. NOP Document me! IGenerate a list of n random integers such that each entry occurs at most 2 once. Each number in the list must be unique. FGenerate a random integer in the specified range that is NOT equal to  the integer provided.  Upper bound. Integer to avoid.    DData type representing a genome. The genome contains all necessary L parameters to interpret a chromosome. These include the alphabet (split K between terminal and nonterminal characters), connective characters for L multi-gene chromosomes, the maximum arity of any nonterminal, the length B of the head of a gene, and the number of genes per chromosome. Set of terminal symbols Set of nonterminal symbols (Symbol connecting genes in a chromosome #Highest arity nonterminal function !Length of gene head sequence "Number of genes per chromosome #?Function to express an individual into a list of ET structures $FSymbol table used for fitness tests. We assume that there is exactly G one pair per symbol. If there are symbols missing, fitness testing C may fail (the library does not have facilities yet to allow for E default values). If a symbol occurs multiple times in the symbol C table, no guarantee is provided for which value will be chosen. %HA chromosome is a list of symbols. We avoided using a list of genes to G maintain the view of a chromosome as nothing more than a flattened,  linear sequence of genes. &,A gene in a chromosome is a list of symbols 'JA sequence of symbols not neccessaryly a gene or chromosome. Used in gene  operations. (A symbol in a chromosome )JGiven a genome, provide the list of all symbols possible in a chromosome. + This is just nonterminals ++ terminals. Genome List of symbols *;Return the length of the tail of a gene for a given genome Genome !Number of symbols in a gene tail +9Return length of a gene (tail + head) for a given genome Genome Total length of a gene. ,"Test if a symbol is a nonterminal Symbol to test Genome providing context 1True if symbol is a nonterminal, false otherwise -*Fracture a chromosome into a set of genes )Chromosome to split into a set of genes Length of a single gene &Ordered list of genes from chromosome .*Assemble a chromosome from a set of genes List of genes  Chromosome assembled from genes  !"#$%&'()*+,-. !"('&%$#*+)-., !" !"#$%&'()*+,-. QLSplits a sequence into three by given positions. Similar to the splitAt but O for two positions. The positions must be in a non-descending order. This is  not checked. /One-point crossover %Pair of individuals before crossover Crossover point $Pair of individuals after crossover 0Two-point crossover %Pair of individuals before crossover Crossover point 1 Crossover point 2 $Pair of individuals after crossover R1Gene crossover %Pair of individuals before crossover Gene number for crossover Gene length in symbols $Pair of individuals after crossover S2'Root insertion sequence transposition. )Sequence to perform RIS transposition on Genome information )Gene to perform RIS transposition within )Position within gene to start search for  RIS for transposition Length of RIS +Sequence after RIS transposition performed T3"Insertion sequence transposition.  Chromosome Genome  Gene number $Position to take from within a gene Length to take Position to put within a gene Resulting chromosome 4Gene transposition.  Chromosome Genome  Gene number Resulting chromosome /01234/01432/012345IS Transposition helper 6RIS Transposition helper 7Gene transposition helper 8DOne-point crossover helper. Takes a genome, a pair of individuals, D and selects the crossover point before generating the new pair of ) resulting individuals after crossover. 9DTwo-point crossover helper. Takes a genome, a pair of individuals, E and selects the crossover points before generating the new pair of ) resulting individuals after crossover. :CGene crossover helper. Takes a genome, a pair of individuals, and ? selects the crossover gene before generating the new pair of ) individuals resulting after crossover. 56789:56789:56789:;/Select a random symbol from the provided list. List of symbols Selected symbol <<Select a sequence of random symbols from the provided list. List of symbols Number to select List of selected  symbols =8Generate a new individual given a genome specification. Genome for individual Number of genes to generate >?Create a population of fresh random individuals given a genome  |specification. Genome of population  Number of individuals to create UKMutate symbols in a gene. Symbols are chosen from terminals and allsymbols / for head and tail of the gene respectively. VIMutate single symbol with probability pMutate choosing from given symbol  list. ?;<=>?;<=>?;<=>?@GGiven a set of pairs (f,i) where f is the fitness of the individual i, E return the pair representing the individual with the best fitness. G We may return nothing if an empty set is passed in to begin with, so # the return type is a Maybe pair. Fitness/Individual pairs &Best pair, or Nothing if no such pair WAGGiven a list of indices and a list of data elements, create a new list F of data elements composed of the elements listed in the index list. * The output list may contain duplicates. List of indices to select List of elements IList composed of elements selected from original set by indices provided XBLGenerate n roulette weights with a generator exponent e. A helper function H weight_function is used to generate the actual weights. For example, K w = (k^e)^(-1) for k from 1 to n leads to a set of weights such that the M size of the slots decreases exponentially as fitness decreases. When e=1, P this decrease is linear. The list that is returned is the width of each slot 2 such that the total of the weights adds to 1.0. CKGiven a set of roulette weights and a number of spins of the wheel, return K a list of indices corresponding to the winning slot for each spin. This N is used to perform the actual selection after a set of roulette weights are  generated. @ABCBCA@@ABC YDZ[\]^_`aDDD EBThe set of outputs expected for each entry in the test dictionary F)A test dictionary is a set of test cases G5A test case maps a list of terminals to float values HFitness function type bIBFitness evaluator for generic individuals. This needs to go away > and use a more general approach like evaluateFitness above. Expressed individual Fitness function %List of symbol tables for test cases (List of expected outputs for test cases #Range of selection. M in original $ GEP paper equations for fitness. #Fitness value for given individual JHGiven a list of fitness values and a corresponding list of individuals, M return a list of tuples pairing the fitness value with the individuals for L only those individuals that have a valid fitness value. This means those  that are +/- infinity or NaN are removed. Fitness values  Individuals Paired fitness/individuals after  filtering K?Sort a set of individuals with fitness values by their fitness EFGHIJKHGFEIJKEFGHIJK c$debugging version of (!!) thanks to #!haskell help. by default we let E (!!!) simply alias (!!), but when we need to we can swap in a new deBReassemble a population. We are given a full population, the set H of individuals that are to be replaced and their indices. The output J of this function is the new population where the unmodified individuals K are carried forward and those that were modified are replaced with their  new versions. "Indices of individuals to replace Replacement individuals Original population New population fghSingle step of GEP algorithm List of individuals Genome Simulation parameters Gene operator rates Expression function Fitness function Fitness inputs Fitness outputs L List of individuals Genome Simulation parameters Gene operator rates Expression function Fitness function Fitness inputs Fitness outputs &Maximum number of generations to test Ideal fitness LLL MIGeneric driver to be called from specific GEP program instances in their  main routine. Simulation parameters Rates for genetic operators 'Genome that individuals are drawn from $Test dictionary for fitness testing *Expected test results for test dictionary Fitness testing function !String to ET expression function .Return best individual fitness and population MMMi    !"#$%%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLM N O P Q R S T U VWXYZ[\]^_`abcdefghij k l m n o p qr HSGEP-0.1.4 GEP.Params GEP.Rmonad GEP.TypesGEP.GeneOperationsGEP.MonadicGeneOperations GEP.Random GEP.SelectionGEP.Util.ConfigurationReader GEP.Fitness GEP.TimeStepGEP.GenericDriverRatespMutatepISpRISpGTp1Rp2RpGR SimParamspopSizerouletteExponent maxFitnessnumGenerationsselectionRangemaxISLen maxRISLenGEPMonadnextFnextR nextRList generatePairsnextRListUniquenextRListPairsnextRDifferent runRmonadGenome terminals nonterminals geneConnectormaxArity headLengthnumGenesExpressionFunctionSymTable ChromosomeGeneSequenceSymbol allsymbols tailLength geneLength isNonterminal chromToGenes genesToChrom crossover1pt crossover2pt crossoverGene transposeRIS transposeIS transposeGene isTransposer risTransposergeneTransposer x1PHelper x2PHelperxGHelper randomSymbolrandomSymbolList newIndividual newPopulationmutategetBestselectorgenerate_roulette_weightsroulettereadParametersTestOutsTestDictTestCaseFitnessFunctionfitness_testerfitness_filter sortByFitness multiStep gepDriver removeNthshufflepairify splitThirds geneExtractfindRISinsertIntoGene mutateGene mutateSymbolweight_function innerSelectextractParameters lookupDouble lookupInt lookupString lookupCharremoveWhitespace splitLine fileToLinesreadConfigurationpairSort!!! intToDouble putTogether fillFilterGapapplyMutations singleStep