var searchIndex = {}; searchIndex["darwin_rs"] = {"doc":"darwin-rs: evolutionary algorithms with Rust","items":[[0,"individual","darwin_rs","This module defines the trait and the data structure needed for specifying each individual in a population.",null,null],[3,"IndividualWrapper","darwin_rs::individual","A wrapper helper struct for the individuals.\nIt does the book keeping of the fitness and the number of mutations this individual\nhas to run in one iteration.",null,null],[12,"individual","","The actual individual, user defined struct.",0,null],[12,"fitness","","The current calculated fitness for this individual.",0,null],[12,"num_of_mutations","","The number of mutation this individual is doing in one iteration.",0,null],[12,"id","","The id of the population that this individual belongs to. Just for statistics",0,null],[8,"Individual","","This trait has to be implemented for the user defined struct.\nTip: Use [lazy_static](https://github.com/rust-lang-nursery/lazy-static.rs) to share large\ndata structure between individuals (see TSP example).",null,null],[10,"new","","This method creates a new individual.",1,{"inputs":[],"output":{"name":"self"}}],[10,"mutate","","This method mutates the individual. Usually this is a cheap and easy to implement\nfunction. In order to improve the simulation, the user can make this function a bit\n"smarter". This is nicely shown in the tsp and tsp2 example. The tsp2 example contains\ntwo types of mutation, tsp just one:",1,null],[10,"calculate_fitness","","This method calculates the fitness for the individual. Usually this is an expensive\noperation and a bit more difficult to implement, compared to the mutation method above.\nThe lower the fitness value, the better (healthier) the individual is and the closer\nthe individual is to the perfect solution. This can also correspont to the number of\nerrors like for example in the sudoku or queens problem case.",1,null],[11,"clone","","",0,null],[11,"fmt","","",0,null],[11,"eq","","",0,null],[11,"cmp","","",0,null],[11,"partial_cmp","","",0,null],[0,"simulation","darwin_rs","This module defines structures and methods for an EA simulation.",null,null],[3,"Simulation","darwin_rs::simulation","The `Simulation` type. Contains all the information / configuration for the simulation to run.\nUse the `SimulationBuilder` in order to create a simulation.",null,null],[12,"type_of_simulation","","How should the simulation stop ?",2,null],[12,"num_of_threads","","The number of threads to use to speed up calculation.",2,null],[12,"habitat","","All the populations for the simulation. Contains all individuals for the simulation.",2,null],[12,"total_time_in_ms","","The total run time for the simulation. This will be calculated once the stimulation has\nfinished.",2,null],[12,"simulation_result","","The result of the simulation: `improvement_factor`, `original_fitness` and a vector of\nfittest individuals",2,null],[3,"SimulationResult","","The `SimulationResult` Type. Holds the simulation results:\nAll the fittest individuals, the `improvement_factor`, the `iteration_counter` and the\n`original_fitness`.",null,null],[12,"improvement_factor","","The current improvement factor, that means the ration between the very first and the\ncurrent fitness.",3,null],[12,"original_fitness","","The very first calculated fitness, when the simulation just started.",3,null],[12,"fittest","","Vector of fittest individuals. This will change during the simulation as soon as a new\nmore fittest individual is found and pushed into the first position (index 0).",3,null],[12,"iteration_counter","","How many iteration did the simulation run",3,null],[4,"SimulationType","","The `SimulationType` type. Speficies the criteria on how a simulation should stop.",null,null],[13,"EndIteration","","Finish the simulation when a number of iteration has been reached.",4,null],[13,"EndFitness","","Finish the simulation when a specific fitness is rached.\nThat means if at least one of the individuals has this fitness.\nThe fitness is calculated using the implemented `calculate_fitness` functions\nof the `Individual` trait",4,null],[13,"EndFactor","","Finish the simulation when a specific improvement factor is reached.\nThat means the relation between the very first fitness and the current fitness of the\nfittest individual",4,null],[11,"clone","","",4,null],[11,"fmt","","",4,null],[11,"clone","","",3,null],[11,"run","","This actually runs the simulation.\nDepending on the type of simulation (`EndIteration`, `EndFactor` or `EndFitness`)\nthe iteration loop will check for the stop condition accordingly.",2,null],[11,"print_fitness","","This is a helper function that the user can call after the simulation stops in order to\nsee all the fitness values for all the individuals that participated to the overall\nimprovement.",2,null],[0,"simulation_builder","darwin_rs","This module defines helper functions (builder pattern) to create a valid simulation.",null,null],[3,"SimulationBuilder","darwin_rs::simulation_builder","This is a helper struct in order to build (configure) a valid simulation.\nSee builder pattern: https://en.wikipedia.org/wiki/Builder_pattern",null,null],[4,"SimError","","",null,null],[13,"EndIterationTooLow","","The number of iteration is too low, should be >= 10",5,null],[6,"Result","","",null,null],[11,"fmt","","",5,null],[11,"fmt","","",5,null],[11,"description","","",5,null],[11,"cause","","",5,null],[11,"new","","Start with this method, it must always be called as the first one.\nIt creates a default simulation with some dummy (but invalid) values.",6,{"inputs":[],"output":{"name":"simulationbuilder"}}],[11,"iterations","","Set the total number of iterations for the simulation and thus sets the simulation\ntype to `EndIteration`. (Only usefull in combination with `EndIteration`).",6,null],[11,"factor","","Set the improvement factor stop criteria for the simulation and thus sets the simulation\ntype to `EndFactor`. (Only usefull in combination with `EndFactor`).",6,null],[11,"fitness","","Set the minimum fitness stop criteria for the simulation and thus sets the simulation\ntype to `EndFitness`. (Only usefull in combination with `EndFactor`).",6,null],[11,"threads","","Sets the number of threads in order to speed up the simulation.",6,null],[11,"add_population","","Add a population to the simulation.",6,null],[11,"finalize","","This checks the configuration of the simulation and returns an error or Ok if no errors\nwhere found.",6,null],[0,"population","darwin_rs","This module defines structure and methods for a population that is needed by a smulation.",null,null],[3,"Population","darwin_rs::population","The `Population` type. Contains the actual individuals (through a wrapper) and informations\nlike the `reset_limit`. Use the `PopulationBuilder` in your main program to create populations.",null,null],[12,"num_of_individuals","","The number of individuals for this population.",7,null],[12,"population","","The actual population (vector of individuals).",7,null],[12,"reset_limit","","The amount of iteration to wait until all individuals will be resetted.",7,null],[12,"reset_limit_start","","The start value of the reset limit",7,null],[12,"reset_limit_end","","The end value of the reset limit, if `reset_limit` >= `reset_limit_end`, then the `reset_limit`\nwill be resettet to the start value `reset_limit_start`.\nIf `reset_limit_end` == 0, this feature will be disabled.",7,null],[12,"reset_limit_increment","","The increment for the `reset_limit`. After the reset_limit value is reached, it will be\nincreased by the value of `reset_limit_increment`.",7,null],[12,"reset_counter","","The reset counter, if `reset_counter` >= `reset_limit`, all the individuals are discarded and\nthe simulation restarts anew with an increased `reset_limit`. This prevents local minima,\nbut also discards the current fittest individual.",7,null],[12,"id","","The ID of the population, only used for statistics. For example: which population does\nhave the most fittest individuals ? This may help you to set the correct parameters for\nyour simulations.",7,null],[11,"clone","","",7,null],[11,"calculate_fitness","","Just calculates the fitness for each individual.",7,null],[11,"run_body","","This is the body that gets called for every iteration.\nThis function does the following:",7,null],[0,"population_builder","darwin_rs","This module defines helper functions (builder pattern) to create a valid population.",null,null],[3,"PopulationBuilder","darwin_rs::population_builder","This is a helper struct in order to build (configure) a valid population.\nSee builder pattern: https://en.wikipedia.org/wiki/Builder_pattern",null,null],[4,"PopError","","",null,null],[13,"IndividualsTooLow","","The number of individuals is too low, should be >= 3",8,null],[13,"LimitEndTooLow","","`reset_limit_start` must be greater than `reset_limit_end`",8,null],[6,"Result","","",null,null],[11,"fmt","","",8,null],[11,"fmt","","",8,null],[11,"description","","",8,null],[11,"cause","","",8,null],[11,"new","","Start with this method, it must always be called as the first one.\nIt creates a default population with some dummy (but invalid) values.",9,{"inputs":[],"output":{"name":"populationbuilder"}}],[11,"individuals","","Sets the number of individuals and creates the population, must be >= 3",9,null],[11,"increasing_mutation_rate","","Configures the mutation rates (number of mutation runs) for all the individuals\nin the population: The first individual will mutate once, the second will mutate twice,\nthe nth individual will Mutate n-times per iteration.",9,null],[11,"increasing_exp_mutation_rate","","Configures the mutation rates (number of mutation runs) for all the individuals in the\npopulation: Instead of a linear growing mutation rate like in the\n`increasing_mutation_rate` function above this sets an exponention mutation rate for\nall the individuals. The first individual will mutate base^1 times, the second will\nmutate base^2 times, and nth will mutate base^n times per iteration.",9,null],[11,"mutation_rate","","Configures the mutation rates (number of mutation runs) for all the individuals in the\npopulation: This allows to specify an arbitrary mutation scheme for each individual.\nThe number of rates must be equal to the number of individuals.",9,null],[11,"reset_limit_start","","Configures the reset limit for the population. If reset_limit_end is greater than zero\nthen a reset counter is increased each iteration. If that counter is greater than the\nlimit, all individuals will be resetted, the limit will be increased by 1000 and the\ncounter is set back to zero. Default value for reset_limit_start is 1000.",9,null],[11,"reset_limit_end","","Configures the end value for the reset_limit. If the reset_limit >= reset_limit_end\nthen the reset_limit will be resetted to the start value reset_limit_start.\nDefault value for reset_limit_end is 100000.\nIf reset_limit_end == 0 then the reset limit feature will be disabled.",9,null],[11,"reset_limit_increment","","Configure the increment for the reset_limit. If the reset_limit is reached, its value\nis incrementet by the amount of reset_limit_increment",9,null],[11,"set_id","","Set the population id. Currently this is only used for statistics",9,null],[11,"finalize","","This checks the configuration of the simulation and returns an PopError or Ok if no PopErrors\nwhere found.",9,null]],"paths":[[3,"IndividualWrapper"],[8,"Individual"],[3,"Simulation"],[3,"SimulationResult"],[4,"SimulationType"],[4,"SimError"],[3,"SimulationBuilder"],[3,"Population"],[4,"PopError"],[3,"PopulationBuilder"]]}; initSearch(searchIndex);