úÎC?î(      !"#$%&'None Alias for mwc : Take a  value and run it in (4, generating all the random values described by the .{It initializes the random number generator. For performance reasons, it is recommended to minimize the number of calls to .)&Randomly draw an element from a vector*'Similar to uniformIn, but using range [a, b) instead of [a, b] and only for integral types.+)Returns a double value from the range of [0, 1)6. If there is no specific reason, then prefer double (0, 1].,$Modify a value with the probability p)*+,The probability pModification function -./01)*+,)*+,None!">Loss value, chromosome, and the best expression indices vectorEvaluated populationList of chromosomes*A function and its symbolic representationOEither a terminal symbol or a three-address code (a function and two pointers) !A chromosome is a vector of genes 2 instance for  3 instance for      None +Evaluate each subexpression in a chromosome4Generate code for the functions with a single outputwLoss function for regression problems with one input and one output. Not normalized with respect to the dataset size.Average population loss Chromosome to evaluateVariable values(Resulting vector of multiple evaluations4Distance functionDataset2Chromosome evaluation function (partially applied evaluate)5   45NoneA function to minimize.NThe argument is a vector evaluation function whose input is a vector (length c'vars1) and ouput is a vector with a different length c'length.DThe result is a vector of the best indices and a scalar loss value.MEP configuration"Probability of constant generationjProbability of variable generation. The probability of operator generation is inferred automatically as 1 - p'const - p'var.Mutation probabilityCrossover probabilityThe chromosome lengthA (sub)population size7Number of subpopulations (1 or more) [not implemented]3Functions pool with their symbolic representationsThe input dimensionality ÞdefaultConfig = Config { p'const = 0.1 , p'var = 0.4 , p'mutation = 0.1 , p'crossover = 0.9 , c'length = 50 , c'popSize = 100 , c'popN = 1 , c'ops = V.empty -- <-- To be overridden , c'vars = 1 } 6=Evaluates a chromosome according to the given loss function."Randomly generate a new populationUsing 3, find how fit is each chromosome in the population $The best phenotype in the generation!%The worst phenotype in the generation"?Selection operator that produces the next evaluated population.zStandard algorithm: the best offspring O replaces the worst individual W in the current population if O is better than W.#Binary tournament selection$Uniform crossover operator%;Mutation operator with up to three mutations per chromosome&AMutation operator with a fixed mutation probability of each gene'mRandomly initialize a new chromosome. By definition, the first gene is terminal (a constant or a variable).7Produce a new random gene8(A randomly generated variable identifier9-A random operation from the operations vector:5Draw a constant from the uniform distribution within  (-0.5, 0.5]6 !"Common configurationCustom loss functionMutation CrossoverIA chromosome selection algorithm. Does not need to be random, but may be.Evaluated populationNew generation#$;<%Common configuration&Probability of gene mutationCommon configuration'Common configuration7!Probability to produce a constant!Probability to produce a variableNumber of input variablesOperations vectorMaximal operation index= Probability p of a constant generation. 1-p2 will be the probability of a variable generation.Number of input variables89:6 !"#$%&' 6 !"#$;<%&'7=89:None   !"#$%&'  !"#$%&'>      !"#$%&'()*+,-./0123456789:;<=>?/@ABCDEFGHIJKLGAWZz14hHfgKeA1ISjepDLAI.MEP AI.MEP.Types AI.MEP.Run AI.MEP.RandomAI.MEP.Operators7e94Xm6T3lX40G06y9QHtnMath.Probable.RandomRandT runRandIO Phenotype Generation PopulationFGeneCVarOp Chromosome $fShowGene$fEqGeneevaluateChromosome generateCoderegressionLoss1avgLoss LossFunctionConfigp'constp'var p'mutation p'crossoverc'length c'popSizec'popNc'opsc'vars defaultConfig initializeevaluatePopulationbestworstevolvebinaryTournament crossover mutation3smoothMutation newChromosomeghc-prim GHC.TypesIOdrawFrom uniformIn_double_withProbabilitymwcra_0lrQ1SkkNA85sa8eZ98xQkSystem.Random.MWCVariatevectorOfVariatevectorOf uniformIndoublebaseGHC.ShowShow GHC.ClassesEq _usedGeneIxsum' phenotypenewnewVarnewOpnewCswap replaceAt newTerminal