var searchIndex = {}; searchIndex["darwin_rs"] = {"doc":"darwin-rs: evolutionary algorithms with Rust","items":[[3,"Simulation","darwin_rs","The `Simulation` type. Contains all the information / configuration for the simulation to run.",null,null],[12,"type_of_simulation","","How should the simulation stop ?",0,null],[12,"num_of_individuals","","The number of individuals for the whole simulation.",0,null],[12,"num_of_threads","","The number of threads to use to speed up calculation.",0,null],[12,"improvement_factor","","The current improvement factor, that means the ration between the first and the current\nfitness.",0,null],[12,"original_fitness","","The very first calculated fitness, when the simulation just started.",0,null],[12,"fittest","","The current fittest individual. This will change during the simulation as soon as a new\nmore fittest individual is found",0,null],[12,"population","","The population for the simulation. Contains all individuals for the simulation.",0,null],[12,"total_time_in_ms","","The total run time for the simulation. This will be calculated once the stimulation has\nfinished.",0,null],[12,"iteration_counter","","The number of current iteration. This changes with every iteration and is used by the\n`EndIteration` enum.",0,null],[12,"reset_limit","","The amount of iteration to wait until all individuals will be resetted.",0,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.",0,null],[12,"output_new_fittest","","A flag that specifies if the sumulation should write a message every time a new most\nfittest individual is found.",0,null],[12,"pool","","The thread pool used by the `jobsteal` crate",0,null],[3,"IndividualWrapper","","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.",1,null],[3,"SimulationBuilder","","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,"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.",2,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",2,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",2,null],[4,"Error","","",null,null],[13,"TooLowEndIteration","","The number of iteration is too low, should be >= 10",3,null],[13,"TooLowIndividuals","","The number of individuals is too low, should be >= 3",3,null],[6,"Result","","",null,null],[8,"Individual","","This trait has to be implemented for the user defined struct.",null,null],[10,"new","","This method creates a new individual.",4,{"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:",4,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.",4,null],[11,"clone","","",2,null],[11,"fmt","","",2,null],[11,"run","","This actually runs the simulation.\nDepending on the type of simulation (EndIteration, EndFactor or Endfitness) the iteration\nloop will check for The\nstop condition accordingly.",0,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.",0,null],[11,"clone","","",1,null],[11,"fmt","","",1,null],[11,"eq","","",1,null],[11,"cmp","","",1,null],[11,"partial_cmp","","",1,null],[11,"fmt","","",3,null],[11,"fmt","","",3,null],[11,"description","","",3,null],[11,"cause","","",3,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.",5,{"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`).",5,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`).",5,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`).",5,null],[11,"individuals","","Sets the number of individuals and creates the population, must be >= 3",5,null],[11,"threads","","Sets the number of threads in order to speed up the simulation.",5,null],[11,"output_new_fittest","","Sets a flag if the simulation should write a message whenever a new fittest\nindividual is found.",5,null],[11,"increasing_mutation_rate","","Configures the mutation rates (number of mutation runs) for all the individuals\nin the sumulation: The first individual will mutate once, the second will mutate twice,\nthe nth individual will Mutate n-times per iteration.",5,null],[11,"increasing_exp_mutation_rate","","Configures the mutation rates (number of mutation runs) for all the individuals in the\nsumulation: 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.",5,null],[11,"mutation_rate","","Configures the mutation rates (number of mutation runs) for all the individuals in the\nsimulation: This allows to specify an arbitrary mutation scheme for each individual.\nThe number of rates must be equal to the number of individuals.",5,null],[11,"reset_limit","","Configures the reset limit for the simulation. If the limit is greater than zero then a\nreset counter is increased each iteration. If that counter is greater than the limit,\nall individuals will be resetted, the limit will be increased by 1000 and the counter is\nset back to zero. Default value is 1000.",5,null],[11,"finalize","","This checks the configuration of the simulation and returns an error or Ok if no errors\nwhere found.",5,null]],"paths":[[3,"Simulation"],[3,"IndividualWrapper"],[4,"SimulationType"],[4,"Error"],[8,"Individual"],[3,"SimulationBuilder"]]}; initSearch(searchIndex);