var searchIndex = {}; searchIndex["rsgenetic"] = {"doc":"# RsGenetic","items":[[0,"pheno","rsgenetic","Contains the definition of a Phenotype.",null,null],[8,"Fitness","rsgenetic::pheno","A `Fitness` value is used to determine the quality of a `Phenotype`.\n`Fitness` values should have an ordering.",null,null],[10,"zero","","Get the zero value of this `Fitness` value.\nThe internal value should be 0.",0,{"inputs":[],"output":{"name":"self"}}],[10,"abs_diff","","Get the absolute difference between two `Fitness` values.",0,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.",1,null],[10,"crossover","","Perform crossover on this Phenotype, returning a new Phenotype.",1,null],[10,"mutate","","Perform mutation on this Phenotype, returning a new Phenotype.",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],[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.",4,{"inputs":[{"name":"vec"}],"output":{"name":"simulatorbuilder"}}],[11,"step","","",4,null],[11,"run","","Run.",4,null],[11,"get","","",4,null],[11,"iterations","","",4,null],[11,"time","","",4,null],[11,"set_selector","","Set the selector of the resulting `Simulator`.",5,null],[11,"set_max_iters","","Set the maximum number of iterations of the resulting `Simulator`.",5,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.",5,null],[11,"build","","",5,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],[11,"new","","Create and return a maximizing selector.",6,{"inputs":[{"name":"usize"}],"output":{"name":"maximizeselector"}}],[11,"select","","",6,null],[11,"new","","Create and return a tournament selector.",7,{"inputs":[{"name":"usize"},{"name":"usize"}],"output":{"name":"tournamentselector"}}],[11,"select","","",7,null],[11,"new","","Create and return a stochastic selector.",8,{"inputs":[{"name":"usize"}],"output":{"name":"stochasticselector"}}],[11,"select","","",8,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` for breeding.",9,null],[0,"types","rsgenetic::sim","This module provides implementations of the `Fitness` trait for\nsome primitive types, such as `i32`, `i64` etcetera.\nThis is because Rust does not allow programmers to implement\na foreign trait for a foreign type, which would stop you as a library user\nfrom using primitive types as fitness values.",null,null],[6,"NanoSecond","","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.",10,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`.",11,null],[10,"builder","","Create a `Builder` to create an instance.",11,{"inputs":[{"name":"vec"}],"output":{"name":"b"}}],[10,"run","","Run the simulation completely.",11,null],[10,"step","","Make one step in the simulation. This function returns a `StepResult`:",11,null],[10,"get","","Get the result of the latest step or of a complete run.",11,null],[10,"time","","Get the number of nanoseconds spent running, or `None` in case of an overflow.",11,null],[10,"iterations","","Get the number of iterations the `Simulator` has executed so far.",11,null],[11,"fmt","","",2,null],[11,"eq","","",2,null],[11,"fmt","","",3,null],[11,"eq","","",3,null]],"paths":[[8,"Fitness"],[8,"Phenotype"],[4,"StepResult"],[4,"RunResult"],[3,"Simulator"],[3,"SimulatorBuilder"],[3,"MaximizeSelector"],[3,"TournamentSelector"],[3,"StochasticSelector"],[8,"Selector"],[8,"Builder"],[8,"Simulation"]]}; initSearch(searchIndex);