var searchIndex = {}; searchIndex["rsgenetic"] = {"doc":"# RsGenetic","items":[[0,"pheno","rsgenetic","Contains the definition of a Phenotype.",null,null],[3,"Fitness","rsgenetic::pheno","`Fitness` is a wrapper struct around a 64-bit floating point type,\nimplementing equality. This is useful to be able to use functions\nfor sorting and comparison, without requiring the population to be\n`cloned`.",null,null],[8,"Phenotype","","Defines what a Phenotype is.\nA Phenotype can breed with other Phenotypes, resulting in a single child.\nA Phenotype can also be mutated.\nFinally, a Phenotype has a certain fitness value associated with it.",null,null],[10,"fitness","","Calculate the fitness of this Phenotype.",0,null],[10,"crossover","","Perform crossover on this Phenotype, returning a new Phenotype.",0,null],[10,"mutate","","Perform mutation on this Phenotype, returning a new Phenotype.",0,null],[11,"clone","","",1,null],[11,"new","","Construct a new `Fitness` object.",1,{"inputs":[{"name":"f64"}],"output":{"name":"fitness"}}],[11,"abs","","Calculate the absolute value of some `Fitness`.",1,null],[11,"into","","",1,null],[11,"eq","","",1,null],[11,"partial_cmp","","",1,null],[11,"cmp","","",1,null],[11,"add","","",1,null],[11,"sub","","",1,null],[11,"fmt","","",1,null],[0,"sim","rsgenetic","Contains implementations of Simulators, which can run genetic algorithms.",null,null],[4,"StepResult","rsgenetic::sim","The result of running a single step.",null,null],[13,"Success","","The step was successful, but the simulation has not finished.",2,null],[13,"Failure","","The step was not successful.",2,null],[13,"Done","","The step was successful and the simulation finished.",2,null],[4,"RunResult","","The result of running an entire simulation.",null,null],[13,"Failure","","An error occurred somewhere during simulation.",3,null],[13,"Done","","The simulation finished without errors.",3,null],[4,"FitnessType","","Whether to maximize or to minimize the fitness value.",null,null],[13,"Maximize","","The `Simulation` will try to increase the fitness value of phenotypes.",4,null],[13,"Minimize","","The `Simulation` will try to decrease the fitness value of phenotypes.",4,null],[0,"seq","","Contains a sequential implementation of `::sim::Simulation`,\ncalled a `Simulator`.",null,null],[3,"Simulator","rsgenetic::sim::seq","A sequential implementation of `::sim::Simulation`.\nThe genetic algorithm is run in a single thread.",null,null],[3,"SimulatorBuilder","","A `Builder` for the `Simulator` type.",null,null],[11,"builder","","Create builder.",5,{"inputs":[{"name":"vec"}],"output":{"name":"simulatorbuilder"}}],[11,"step","","",5,null],[11,"run","","Run.",5,null],[11,"get","","",5,null],[11,"iterations","","",5,null],[11,"time","","",5,null],[11,"set_selector","","Set the selector of the resulting `Simulator`.",6,null],[11,"set_max_iters","","Set the maximum number of iterations of the resulting `Simulator`.",6,null],[11,"set_fitness_type","","Set the fitness type of the resulting `Simulator`,\ndetermining whether the `Simulator` will try to maximize\nor minimize the fitness values of `Phenotype`s.",6,null],[11,"set_early_stop","","Set early stopping. If for `n_iters` iterations, the change in the highest fitness\nis smaller than `delta`, the simulator will stop running.",6,null],[11,"build","","",6,null],[0,"select","rsgenetic::sim","The selection module provides a trait that can be implemented\nto implement new selection algorithms. This module also provides a couple\nof useful selection algorithms.",null,null],[3,"MaximizeSelector","rsgenetic::sim::select","Selects best performing phenotypes from the population.",null,null],[3,"TournamentSelector","","Runs several tournaments, and selects best performing phenotypes from each tournament.",null,null],[3,"StochasticSelector","","Selects phenotypes at random, starting from a random index and taking equidistant jumps.",null,null],[3,"RouletteSelector","","Selects phenotypes with a probability based on their fitness value.",null,null],[11,"new","","Create and return a maximizing selector.",7,{"inputs":[{"name":"usize"}],"output":{"name":"maximizeselector"}}],[11,"select","","",7,null],[11,"new","","Create and return a tournament selector.",8,{"inputs":[{"name":"usize"},{"name":"usize"}],"output":{"name":"tournamentselector"}}],[11,"select","","",8,null],[11,"new","","Create and return a stochastic selector.",9,{"inputs":[{"name":"usize"}],"output":{"name":"stochasticselector"}}],[11,"select","","",9,null],[11,"new","","Create and return a roulette selector.",10,{"inputs":[{"name":"usize"}],"output":{"name":"rouletteselector"}}],[11,"select","","",10,null],[6,"Parents","","`Parents` come in a `Vec` of two `T`'s.",null,null],[8,"Selector","","A `Selector` can select `Parents` for a new iteration of a `Simulation`.",null,null],[10,"select","","Select elements from a `population`, either maximizing or minimizing the fitness\n(`fitness_type`).",11,null],[6,"NanoSecond","rsgenetic::sim","Simulation run time is defined in nanoseconds.",null,null],[6,"SimResult","","The result of a simulation, containing the best phenotype\nor an error message.",null,null],[8,"Builder","","A `Builder` can create new instances of an object.\nFor this library, only `Simulation` objects use this `Builder`.",null,null],[10,"build","","Return the result.",12,null],[8,"Simulation","","A `Simulation` is an execution of a genetic algorithm.",null,null],[16,"B","","A `Builder` is used to create instances of a `Simulation`.",13,null],[10,"builder","","Create a `Builder` to create an instance.",13,{"inputs":[{"name":"vec"}],"output":{"name":"b"}}],[10,"run","","Run the simulation completely.",13,null],[10,"step","","Make one step in the simulation. This function returns a `StepResult`:",13,null],[10,"get","","Get the result of the latest step or of a complete run.",13,null],[10,"time","","Get the number of nanoseconds spent running, or `None` in case of an overflow.",13,null],[10,"iterations","","Get the number of iterations the `Simulator` has executed so far.",13,null],[11,"fmt","","",2,null],[11,"eq","","",2,null],[11,"fmt","","",3,null],[11,"eq","","",3,null],[11,"clone","","",4,null]],"paths":[[8,"Phenotype"],[3,"Fitness"],[4,"StepResult"],[4,"RunResult"],[4,"FitnessType"],[3,"Simulator"],[3,"SimulatorBuilder"],[3,"MaximizeSelector"],[3,"TournamentSelector"],[3,"StochasticSelector"],[3,"RouletteSelector"],[8,"Selector"],[8,"Builder"],[8,"Simulation"]]}; initSearch(searchIndex);