evosynth 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/INSTALL +74 -0
- data/LICENSE +22 -0
- data/README +57 -0
- data/Rakefile +132 -0
- data/TODO +88 -0
- data/docs/FEATURES +111 -0
- data/docs/rdoc/classes/EvoSynth.html +2643 -0
- data/docs/rdoc/classes/EvoSynth/Adjustments.html +119 -0
- data/docs/rdoc/classes/EvoSynth/Adjustments/AdaptiveAdjustment.html +264 -0
- data/docs/rdoc/classes/EvoSynth/Adjustments/PredifinedAdjustment.html +235 -0
- data/docs/rdoc/classes/EvoSynth/ArrayGenome.html +313 -0
- data/docs/rdoc/classes/EvoSynth/BinaryGenome.html +518 -0
- data/docs/rdoc/classes/EvoSynth/Decoder.html +286 -0
- data/docs/rdoc/classes/EvoSynth/Evaluator.html +466 -0
- data/docs/rdoc/classes/EvoSynth/Evolvers.html +469 -0
- data/docs/rdoc/classes/EvoSynth/Evolvers/AdaptiveES.html +448 -0
- data/docs/rdoc/classes/EvoSynth/Evolvers/BalancedCoevolutionary.html +439 -0
- data/docs/rdoc/classes/EvoSynth/Evolvers/DerandomizedES.html +450 -0
- data/docs/rdoc/classes/EvoSynth/Evolvers/Evolver.html +125 -0
- data/docs/rdoc/classes/EvoSynth/Evolvers/GeneticAlgorithm.html +467 -0
- data/docs/rdoc/classes/EvoSynth/Evolvers/Hillclimber.html +343 -0
- data/docs/rdoc/classes/EvoSynth/Evolvers/LocalSearch.html +422 -0
- data/docs/rdoc/classes/EvoSynth/Evolvers/LocalSearch/GreatDelugeAcceptance.html +287 -0
- data/docs/rdoc/classes/EvoSynth/Evolvers/LocalSearch/HillclimberAcceptance.html +197 -0
- data/docs/rdoc/classes/EvoSynth/Evolvers/LocalSearch/RecordToRecordTravelAcceptance.html +296 -0
- data/docs/rdoc/classes/EvoSynth/Evolvers/LocalSearch/SimulatedAnnealingAcceptance.html +286 -0
- data/docs/rdoc/classes/EvoSynth/Evolvers/LocalSearch/ThresholdAcceptance.html +287 -0
- data/docs/rdoc/classes/EvoSynth/Evolvers/MemeticAlgorithm.html +441 -0
- data/docs/rdoc/classes/EvoSynth/Evolvers/PopulationHillclimber.html +375 -0
- data/docs/rdoc/classes/EvoSynth/Evolvers/ProfileUsingEvolver.html +205 -0
- data/docs/rdoc/classes/EvoSynth/Evolvers/RoundRobinCoevolutionary.html +383 -0
- data/docs/rdoc/classes/EvoSynth/Evolvers/RunnableEvolver.html +279 -0
- data/docs/rdoc/classes/EvoSynth/Evolvers/RunnableEvolver/Goal.html +193 -0
- data/docs/rdoc/classes/EvoSynth/Evolvers/SelfAdaptiveES.html +394 -0
- data/docs/rdoc/classes/EvoSynth/Evolvers/SteadyStateGA.html +390 -0
- data/docs/rdoc/classes/EvoSynth/GlobalRecombinations.html +119 -0
- data/docs/rdoc/classes/EvoSynth/GlobalRecombinations/GlobalArithmeticCrossover.html +204 -0
- data/docs/rdoc/classes/EvoSynth/GlobalRecombinations/GlobalUniformCrossover.html +203 -0
- data/docs/rdoc/classes/EvoSynth/Individual.html +561 -0
- data/docs/rdoc/classes/EvoSynth/MaximizingIndividual.html +266 -0
- data/docs/rdoc/classes/EvoSynth/MetaOperators.html +149 -0
- data/docs/rdoc/classes/EvoSynth/MetaOperators/ConditionalCombinedOperator.html +278 -0
- data/docs/rdoc/classes/EvoSynth/MetaOperators/ProportionalCombinedOperator.html +285 -0
- data/docs/rdoc/classes/EvoSynth/MetaOperators/SequentialCombinedOperator.html +290 -0
- data/docs/rdoc/classes/EvoSynth/MinimizingIndividual.html +266 -0
- data/docs/rdoc/classes/EvoSynth/Mutations.html +251 -0
- data/docs/rdoc/classes/EvoSynth/Mutations/BinaryMutation.html +336 -0
- data/docs/rdoc/classes/EvoSynth/Mutations/EfficientBinaryMutation.html +345 -0
- data/docs/rdoc/classes/EvoSynth/Mutations/ExchangeMutation.html +320 -0
- data/docs/rdoc/classes/EvoSynth/Mutations/Functions.html +160 -0
- data/docs/rdoc/classes/EvoSynth/Mutations/GaussMutation.html +311 -0
- data/docs/rdoc/classes/EvoSynth/Mutations/Identity.html +220 -0
- data/docs/rdoc/classes/EvoSynth/Mutations/InversionMutation.html +231 -0
- data/docs/rdoc/classes/EvoSynth/Mutations/MixingMutation.html +233 -0
- data/docs/rdoc/classes/EvoSynth/Mutations/OneGeneFlipping.html +295 -0
- data/docs/rdoc/classes/EvoSynth/Mutations/SelfAdaptiveGaussMutation.html +347 -0
- data/docs/rdoc/classes/EvoSynth/Mutations/ShiftingMutation.html +229 -0
- data/docs/rdoc/classes/EvoSynth/Mutations/UniformRealMutation.html +264 -0
- data/docs/rdoc/classes/EvoSynth/Output.html +212 -0
- data/docs/rdoc/classes/EvoSynth/Output/CSVExporter.html +211 -0
- data/docs/rdoc/classes/EvoSynth/Output/ConsoleWriter.html +194 -0
- data/docs/rdoc/classes/EvoSynth/Output/GnuPlotExporter.html +235 -0
- data/docs/rdoc/classes/EvoSynth/Output/GruffExporter.html +219 -0
- data/docs/rdoc/classes/EvoSynth/Output/Logger.html +345 -0
- data/docs/rdoc/classes/EvoSynth/Population.html +430 -0
- data/docs/rdoc/classes/EvoSynth/Problems.html +159 -0
- data/docs/rdoc/classes/EvoSynth/Problems/BinaryBenchmarkFuntions.html +258 -0
- data/docs/rdoc/classes/EvoSynth/Problems/FloatBenchmarkFuntions.html +406 -0
- data/docs/rdoc/classes/EvoSynth/Problems/GraphColouring.html +265 -0
- data/docs/rdoc/classes/EvoSynth/Problems/TSP.html +327 -0
- data/docs/rdoc/classes/EvoSynth/Profile.html +324 -0
- data/docs/rdoc/classes/EvoSynth/Recombinations.html +251 -0
- data/docs/rdoc/classes/EvoSynth/Recombinations/ArithmeticCrossover.html +286 -0
- data/docs/rdoc/classes/EvoSynth/Recombinations/EdgeRecombination.html +203 -0
- data/docs/rdoc/classes/EvoSynth/Recombinations/Identity.html +192 -0
- data/docs/rdoc/classes/EvoSynth/Recombinations/KPointCrossover.html +286 -0
- data/docs/rdoc/classes/EvoSynth/Recombinations/OnePointCrossover.html +211 -0
- data/docs/rdoc/classes/EvoSynth/Recombinations/OrderedRecombination.html +206 -0
- data/docs/rdoc/classes/EvoSynth/Recombinations/PartiallyMappedCrossover.html +206 -0
- data/docs/rdoc/classes/EvoSynth/Recombinations/UniformCrossover.html +208 -0
- data/docs/rdoc/classes/EvoSynth/Selections.html +174 -0
- data/docs/rdoc/classes/EvoSynth/Selections/FitnessProportionalSelection.html +206 -0
- data/docs/rdoc/classes/EvoSynth/Selections/Identity.html +200 -0
- data/docs/rdoc/classes/EvoSynth/Selections/NStageTournamentSelection.html +273 -0
- data/docs/rdoc/classes/EvoSynth/Selections/RandomSelection.html +192 -0
- data/docs/rdoc/classes/EvoSynth/Selections/RouletteWheelSelection.html +212 -0
- data/docs/rdoc/classes/EvoSynth/Selections/SelectBest.html +206 -0
- data/docs/rdoc/classes/EvoSynth/Selections/TournamentSelection.html +274 -0
- data/docs/rdoc/classes/Examples.html +268 -0
- data/docs/rdoc/classes/Examples/Ants.html +198 -0
- data/docs/rdoc/classes/Examples/Ants/AntMutation.html +381 -0
- data/docs/rdoc/classes/Examples/Ants/Pheromon.html +256 -0
- data/docs/rdoc/classes/Examples/CCGAExample.html +305 -0
- data/docs/rdoc/classes/Examples/CCGAExample/CCGA2BenchmarkEvaluator.html +165 -0
- data/docs/rdoc/classes/Examples/CCGAExample/CCGABenchmarkEvaluator.html +242 -0
- data/docs/rdoc/classes/Examples/CCGAExample/CCGAIndividual.html +181 -0
- data/docs/rdoc/classes/Examples/CMBExample.html +215 -0
- data/docs/rdoc/classes/Examples/CMBExample/CMBEvaluator.html +212 -0
- data/docs/rdoc/classes/Examples/EsExample.html +270 -0
- data/docs/rdoc/classes/Examples/EsExample/BenchmarkEvaluator.html +162 -0
- data/docs/rdoc/classes/Examples/Exporter.html +208 -0
- data/docs/rdoc/classes/Examples/Exporter/ExporterEvaluator.html +196 -0
- data/docs/rdoc/classes/Examples/GraphColouring.html +199 -0
- data/docs/rdoc/classes/Examples/Hacking.html +147 -0
- data/docs/rdoc/classes/Examples/Hacking/HackingEvaluator.html +169 -0
- data/docs/rdoc/classes/Examples/LocalSearch.html +294 -0
- data/docs/rdoc/classes/Examples/LocalSearch/LocalSearchEvaluator.html +198 -0
- data/docs/rdoc/classes/Examples/MaxOnes.html +187 -0
- data/docs/rdoc/classes/Examples/MaxOnes/MaxOnesEvaluator.html +170 -0
- data/docs/rdoc/classes/Examples/Partitionproblem.html +201 -0
- data/docs/rdoc/classes/Examples/Partitionproblem/PartitionEvaluator.html +164 -0
- data/docs/rdoc/classes/Examples/Partitionproblem/PartitionIndividual.html +334 -0
- data/docs/rdoc/classes/Examples/Partitionproblem/PartitionMutation.html +199 -0
- data/docs/rdoc/classes/Examples/Partitionproblem/Testdata.html +294 -0
- data/docs/rdoc/classes/Examples/SPk.html +139 -0
- data/docs/rdoc/classes/Examples/SPk/SPkFitnessEvaluator.html +299 -0
- data/docs/rdoc/classes/Examples/TSP.html +187 -0
- data/docs/rdoc/created.rid +1 -0
- data/docs/rdoc/files/INSTALL.html +253 -0
- data/docs/rdoc/files/LICENSE.html +119 -0
- data/docs/rdoc/files/README.html +235 -0
- data/docs/rdoc/files/docs/FEATURES.html +428 -0
- data/docs/rdoc/files/examples/ants_rb.html +133 -0
- data/docs/rdoc/files/examples/ccga_example_rb.html +129 -0
- data/docs/rdoc/files/examples/cmb_example_rb.html +129 -0
- data/docs/rdoc/files/examples/evolution_strategies_rb.html +129 -0
- data/docs/rdoc/files/examples/exporter_rb.html +129 -0
- data/docs/rdoc/files/examples/graph_colouring_rb.html +129 -0
- data/docs/rdoc/files/examples/hacking_rb.html +129 -0
- data/docs/rdoc/files/examples/local_search_rb.html +129 -0
- data/docs/rdoc/files/examples/max_ones_rb.html +129 -0
- data/docs/rdoc/files/examples/partition_rb.html +131 -0
- data/docs/rdoc/files/examples/spk_rb.html +129 -0
- data/docs/rdoc/files/examples/tsp_rb.html +131 -0
- data/docs/rdoc/files/lib/evosynth/core/array_genome_rb.html +119 -0
- data/docs/rdoc/files/lib/evosynth/core/binary_genome_rb.html +119 -0
- data/docs/rdoc/files/lib/evosynth/core/evaluator_rb.html +129 -0
- data/docs/rdoc/files/lib/evosynth/core/individual_rb.html +119 -0
- data/docs/rdoc/files/lib/evosynth/core/maximizing_individual_rb.html +119 -0
- data/docs/rdoc/files/lib/evosynth/core/minimizing_individual_rb.html +119 -0
- data/docs/rdoc/files/lib/evosynth/core/population_rb.html +119 -0
- data/docs/rdoc/files/lib/evosynth/core/profile_rb.html +119 -0
- data/docs/rdoc/files/lib/evosynth/core/randomizer_rb.html +119 -0
- data/docs/rdoc/files/lib/evosynth/core_rb.html +145 -0
- data/docs/rdoc/files/lib/evosynth/decoder/binary_to_real_rb.html +119 -0
- data/docs/rdoc/files/lib/evosynth/decoder/gray_rb.html +119 -0
- data/docs/rdoc/files/lib/evosynth/decoder_rb.html +131 -0
- data/docs/rdoc/files/lib/evosynth/evolvers/basic/genetic_algorithm_rb.html +119 -0
- data/docs/rdoc/files/lib/evosynth/evolvers/basic/hillclimber_rb.html +119 -0
- data/docs/rdoc/files/lib/evosynth/evolvers/basic/memetic_algorithm_rb.html +119 -0
- data/docs/rdoc/files/lib/evosynth/evolvers/basic/population_hillclimber_rb.html +119 -0
- data/docs/rdoc/files/lib/evosynth/evolvers/basic/steady_state_ga_rb.html +119 -0
- data/docs/rdoc/files/lib/evosynth/evolvers/coevolutionary/balanced_coevolutionary_rb.html +119 -0
- data/docs/rdoc/files/lib/evosynth/evolvers/coevolutionary/round_robin_coevolutionary_rb.html +119 -0
- data/docs/rdoc/files/lib/evosynth/evolvers/elitism_rb.html +119 -0
- data/docs/rdoc/files/lib/evosynth/evolvers/evolution_strategies/adaptive_es_rb.html +129 -0
- data/docs/rdoc/files/lib/evosynth/evolvers/evolution_strategies/derandomized_es_rb.html +129 -0
- data/docs/rdoc/files/lib/evosynth/evolvers/evolution_strategies/selfadaptive_es_rb.html +119 -0
- data/docs/rdoc/files/lib/evosynth/evolvers/evolver_rb.html +131 -0
- data/docs/rdoc/files/lib/evosynth/evolvers/local_search/acceptance_great_deluge_rb.html +119 -0
- data/docs/rdoc/files/lib/evosynth/evolvers/local_search/acceptance_hillclimber_rb.html +119 -0
- data/docs/rdoc/files/lib/evosynth/evolvers/local_search/acceptance_record_to_record_rb.html +119 -0
- data/docs/rdoc/files/lib/evosynth/evolvers/local_search/acceptance_simulated_annealing_rb.html +119 -0
- data/docs/rdoc/files/lib/evosynth/evolvers/local_search/acceptance_threshold_rb.html +119 -0
- data/docs/rdoc/files/lib/evosynth/evolvers/local_search/local_search_rb.html +137 -0
- data/docs/rdoc/files/lib/evosynth/evolvers/profile_using_evolver_rb.html +119 -0
- data/docs/rdoc/files/lib/evosynth/evolvers/runnable_evolver_rb.html +129 -0
- data/docs/rdoc/files/lib/evosynth/evolvers_rb.html +153 -0
- data/docs/rdoc/files/lib/evosynth/operators/adjustments/adaptive_adjustment_rb.html +119 -0
- data/docs/rdoc/files/lib/evosynth/operators/adjustments/predefined_adjustment_rb.html +119 -0
- data/docs/rdoc/files/lib/evosynth/operators/adjustments_rb.html +131 -0
- data/docs/rdoc/files/lib/evosynth/operators/global_recombinations/global_arithmetic_crossover_rb.html +119 -0
- data/docs/rdoc/files/lib/evosynth/operators/global_recombinations/global_uniform_crossover_rb.html +119 -0
- data/docs/rdoc/files/lib/evosynth/operators/global_recombinations_rb.html +131 -0
- data/docs/rdoc/files/lib/evosynth/operators/meta_operators/conditional_combined_operator_rb.html +119 -0
- data/docs/rdoc/files/lib/evosynth/operators/meta_operators/proportional_combined_operator_rb.html +119 -0
- data/docs/rdoc/files/lib/evosynth/operators/meta_operators/sequential_combined_operator_rb.html +119 -0
- data/docs/rdoc/files/lib/evosynth/operators/meta_operators_rb.html +133 -0
- data/docs/rdoc/files/lib/evosynth/operators/mutations/binary_mutation_rb.html +119 -0
- data/docs/rdoc/files/lib/evosynth/operators/mutations/efficient_binary_mutation_rb.html +119 -0
- data/docs/rdoc/files/lib/evosynth/operators/mutations/exchange_mutation_rb.html +119 -0
- data/docs/rdoc/files/lib/evosynth/operators/mutations/flip_functions_rb.html +119 -0
- data/docs/rdoc/files/lib/evosynth/operators/mutations/gauss_mutation_rb.html +119 -0
- data/docs/rdoc/files/lib/evosynth/operators/mutations/identity_rb.html +119 -0
- data/docs/rdoc/files/lib/evosynth/operators/mutations/inversion_mutation_rb.html +119 -0
- data/docs/rdoc/files/lib/evosynth/operators/mutations/mixing_mutation_rb.html +119 -0
- data/docs/rdoc/files/lib/evosynth/operators/mutations/one_gene_flipping_rb.html +119 -0
- data/docs/rdoc/files/lib/evosynth/operators/mutations/self_adaptive_gauss_mutation_rb.html +119 -0
- data/docs/rdoc/files/lib/evosynth/operators/mutations/shifting_mutation_rb.html +119 -0
- data/docs/rdoc/files/lib/evosynth/operators/mutations/uniform_real_mutation_rb.html +119 -0
- data/docs/rdoc/files/lib/evosynth/operators/mutations_rb.html +151 -0
- data/docs/rdoc/files/lib/evosynth/operators/recombinations/arithmetic_crossover_rb.html +119 -0
- data/docs/rdoc/files/lib/evosynth/operators/recombinations/edge_recombination_rb.html +129 -0
- data/docs/rdoc/files/lib/evosynth/operators/recombinations/identity_rb.html +119 -0
- data/docs/rdoc/files/lib/evosynth/operators/recombinations/k_point_crossover_rb.html +119 -0
- data/docs/rdoc/files/lib/evosynth/operators/recombinations/one_point_crossover_rb.html +119 -0
- data/docs/rdoc/files/lib/evosynth/operators/recombinations/ordered_recombination_rb.html +129 -0
- data/docs/rdoc/files/lib/evosynth/operators/recombinations/partially_mapped_crossover_rb.html +129 -0
- data/docs/rdoc/files/lib/evosynth/operators/recombinations/uniform_crossover_rb.html +119 -0
- data/docs/rdoc/files/lib/evosynth/operators/recombinations_rb.html +143 -0
- data/docs/rdoc/files/lib/evosynth/operators/selections/best_selection_rb.html +119 -0
- data/docs/rdoc/files/lib/evosynth/operators/selections/fitness_proportional_selection_rb.html +119 -0
- data/docs/rdoc/files/lib/evosynth/operators/selections/identity_rb.html +119 -0
- data/docs/rdoc/files/lib/evosynth/operators/selections/n_stage_tournament_selection_rb.html +119 -0
- data/docs/rdoc/files/lib/evosynth/operators/selections/random_selection_rb.html +119 -0
- data/docs/rdoc/files/lib/evosynth/operators/selections/roulette_wheel_selection_rb.html +119 -0
- data/docs/rdoc/files/lib/evosynth/operators/selections/tournament_selection_rb.html +119 -0
- data/docs/rdoc/files/lib/evosynth/operators/selections_rb.html +141 -0
- data/docs/rdoc/files/lib/evosynth/operators_rb.html +139 -0
- data/docs/rdoc/files/lib/evosynth/output/console_writer_rb.html +129 -0
- data/docs/rdoc/files/lib/evosynth/output/exporter/csv_exporter_rb.html +129 -0
- data/docs/rdoc/files/lib/evosynth/output/exporter/gnuplot_exporter_rb.html +131 -0
- data/docs/rdoc/files/lib/evosynth/output/exporter/gruff_exporter_rb.html +131 -0
- data/docs/rdoc/files/lib/evosynth/output/exporter_rb.html +133 -0
- data/docs/rdoc/files/lib/evosynth/output/factory_rb.html +129 -0
- data/docs/rdoc/files/lib/evosynth/output/logger_rb.html +119 -0
- data/docs/rdoc/files/lib/evosynth/output_rb.html +135 -0
- data/docs/rdoc/files/lib/evosynth/problems/binary_benchmark_functions_rb.html +119 -0
- data/docs/rdoc/files/lib/evosynth/problems/float_benchmark_functions_rb.html +1630 -0
- data/docs/rdoc/files/lib/evosynth/problems/graph_colouring_rb.html +129 -0
- data/docs/rdoc/files/lib/evosynth/problems/tsp_rb.html +129 -0
- data/docs/rdoc/files/lib/evosynth/problems_rb.html +135 -0
- data/docs/rdoc/files/lib/evosynth_rb.html +139 -0
- data/docs/rdoc/fr_class_index.html +245 -0
- data/docs/rdoc/fr_file_index.html +233 -0
- data/docs/rdoc/fr_method_index.html +661 -0
- data/docs/rdoc/index.html +21 -0
- data/docs/rdoc/rdoc-style.css +299 -0
- data/examples/ants.rb +237 -0
- data/examples/ccga_example.rb +150 -0
- data/examples/cmb_example.rb +117 -0
- data/examples/evolution_strategies.rb +84 -0
- data/examples/exporter.rb +90 -0
- data/examples/graph_colouring.rb +72 -0
- data/examples/hacking.rb +62 -0
- data/examples/local_search.rb +109 -0
- data/examples/max_ones.rb +83 -0
- data/examples/partition.rb +172 -0
- data/examples/spk.rb +106 -0
- data/examples/tsp.rb +83 -0
- data/lib/evosynth.rb +32 -0
- data/lib/evosynth/core.rb +33 -0
- data/lib/evosynth/core/array_genome.rb +77 -0
- data/lib/evosynth/core/binary_genome.rb +156 -0
- data/lib/evosynth/core/evaluator.rb +109 -0
- data/lib/evosynth/core/individual.rb +92 -0
- data/lib/evosynth/core/maximizing_individual.rb +71 -0
- data/lib/evosynth/core/minimizing_individual.rb +71 -0
- data/lib/evosynth/core/population.rb +120 -0
- data/lib/evosynth/core/profile.rb +110 -0
- data/lib/evosynth/core/randomizer.rb +73 -0
- data/lib/evosynth/decoder.rb +33 -0
- data/lib/evosynth/decoder/binary_to_real.rb +57 -0
- data/lib/evosynth/decoder/gray.rb +54 -0
- data/lib/evosynth/evolvers.rb +41 -0
- data/lib/evosynth/evolvers/basic/genetic_algorithm.rb +92 -0
- data/lib/evosynth/evolvers/basic/hillclimber.rb +64 -0
- data/lib/evosynth/evolvers/basic/memetic_algorithm.rb +111 -0
- data/lib/evosynth/evolvers/basic/population_hillclimber.rb +69 -0
- data/lib/evosynth/evolvers/basic/steady_state_ga.rb +85 -0
- data/lib/evosynth/evolvers/coevolutionary/balanced_coevolutionary.rb +125 -0
- data/lib/evosynth/evolvers/coevolutionary/round_robin_coevolutionary.rb +87 -0
- data/lib/evosynth/evolvers/elitism.rb +108 -0
- data/lib/evosynth/evolvers/evolution_strategies/adaptive_es.rb +104 -0
- data/lib/evosynth/evolvers/evolution_strategies/derandomized_es.rb +120 -0
- data/lib/evosynth/evolvers/evolution_strategies/selfadaptive_es.rb +82 -0
- data/lib/evosynth/evolvers/evolver.rb +43 -0
- data/lib/evosynth/evolvers/local_search/acceptance_great_deluge.rb +60 -0
- data/lib/evosynth/evolvers/local_search/acceptance_hillclimber.rb +47 -0
- data/lib/evosynth/evolvers/local_search/acceptance_record_to_record.rb +69 -0
- data/lib/evosynth/evolvers/local_search/acceptance_simulated_annealing.rb +59 -0
- data/lib/evosynth/evolvers/local_search/acceptance_threshold.rb +60 -0
- data/lib/evosynth/evolvers/local_search/local_search.rb +74 -0
- data/lib/evosynth/evolvers/profile_using_evolver.rb +77 -0
- data/lib/evosynth/evolvers/runnable_evolver.rb +89 -0
- data/lib/evosynth/operators.rb +30 -0
- data/lib/evosynth/operators/adjustments.rb +26 -0
- data/lib/evosynth/operators/adjustments/adaptive_adjustment.rb +55 -0
- data/lib/evosynth/operators/adjustments/predefined_adjustment.rb +46 -0
- data/lib/evosynth/operators/global_recombinations.rb +26 -0
- data/lib/evosynth/operators/global_recombinations/global_arithmetic_crossover.rb +50 -0
- data/lib/evosynth/operators/global_recombinations/global_uniform_crossover.rb +49 -0
- data/lib/evosynth/operators/meta_operators.rb +36 -0
- data/lib/evosynth/operators/meta_operators/conditional_combined_operator.rb +65 -0
- data/lib/evosynth/operators/meta_operators/proportional_combined_operator.rb +84 -0
- data/lib/evosynth/operators/meta_operators/sequential_combined_operator.rb +73 -0
- data/lib/evosynth/operators/mutations.rb +47 -0
- data/lib/evosynth/operators/mutations/binary_mutation.rb +100 -0
- data/lib/evosynth/operators/mutations/efficient_binary_mutation.rb +105 -0
- data/lib/evosynth/operators/mutations/exchange_mutation.rb +107 -0
- data/lib/evosynth/operators/mutations/flip_functions.rb +45 -0
- data/lib/evosynth/operators/mutations/gauss_mutation.rb +65 -0
- data/lib/evosynth/operators/mutations/identity.rb +62 -0
- data/lib/evosynth/operators/mutations/inversion_mutation.rb +73 -0
- data/lib/evosynth/operators/mutations/mixing_mutation.rb +75 -0
- data/lib/evosynth/operators/mutations/one_gene_flipping.rb +89 -0
- data/lib/evosynth/operators/mutations/self_adaptive_gauss_mutation.rb +73 -0
- data/lib/evosynth/operators/mutations/shifting_mutation.rb +88 -0
- data/lib/evosynth/operators/mutations/uniform_real_mutation.rb +59 -0
- data/lib/evosynth/operators/recombinations.rb +48 -0
- data/lib/evosynth/operators/recombinations/arithmetic_crossover.rb +67 -0
- data/lib/evosynth/operators/recombinations/edge_recombination.rb +108 -0
- data/lib/evosynth/operators/recombinations/identity.rb +42 -0
- data/lib/evosynth/operators/recombinations/k_point_crossover.rb +81 -0
- data/lib/evosynth/operators/recombinations/one_point_crossover.rb +56 -0
- data/lib/evosynth/operators/recombinations/ordered_recombination.rb +75 -0
- data/lib/evosynth/operators/recombinations/partially_mapped_crossover.rb +102 -0
- data/lib/evosynth/operators/recombinations/uniform_crossover.rb +54 -0
- data/lib/evosynth/operators/selections.rb +31 -0
- data/lib/evosynth/operators/selections/best_selection.rb +54 -0
- data/lib/evosynth/operators/selections/fitness_proportional_selection.rb +83 -0
- data/lib/evosynth/operators/selections/identity.rb +48 -0
- data/lib/evosynth/operators/selections/n_stage_tournament_selection.rb +84 -0
- data/lib/evosynth/operators/selections/random_selection.rb +44 -0
- data/lib/evosynth/operators/selections/roulette_wheel_selection.rb +54 -0
- data/lib/evosynth/operators/selections/tournament_selection.rb +71 -0
- data/lib/evosynth/output.rb +28 -0
- data/lib/evosynth/output/console_writer.rb +45 -0
- data/lib/evosynth/output/exporter.rb +27 -0
- data/lib/evosynth/output/exporter/csv_exporter.rb +62 -0
- data/lib/evosynth/output/exporter/gnuplot_exporter.rb +81 -0
- data/lib/evosynth/output/exporter/gruff_exporter.rb +70 -0
- data/lib/evosynth/output/factory.rb +38 -0
- data/lib/evosynth/output/logger.rb +83 -0
- data/lib/evosynth/problems.rb +37 -0
- data/lib/evosynth/problems/binary_benchmark_functions.rb +74 -0
- data/lib/evosynth/problems/float_benchmark_functions.rb +99 -0
- data/lib/evosynth/problems/graph_colouring.rb +89 -0
- data/lib/evosynth/problems/tsp.rb +88 -0
- data/test/benchmark/decoder_benchmark.rb +75 -0
- data/test/benchmark/mutation_benchmark.rb +88 -0
- data/test/benchmark/recombination_benchmark.rb +58 -0
- data/test/benchmark/selection_benchmark.rb +52 -0
- data/test/core/tc_array_genome.rb +154 -0
- data/test/core/tc_binary_genome.rb +160 -0
- data/test/core/tc_population.rb +154 -0
- data/test/core/tc_profile.rb +75 -0
- data/test/core/tc_randomizer.rb +165 -0
- data/test/coverage.rb +43 -0
- data/test/decoder/tc_binary_to_real.rb +52 -0
- data/test/decoder/tc_gray.rb +107 -0
- data/test/operators/adjustments/tc_adaptive_adjustment.rb +63 -0
- data/test/operators/adjustments/tc_predefined_adjustment.rb +49 -0
- data/test/operators/global_recombinations/tc_global_arithmetic_crossover.rb +78 -0
- data/test/operators/global_recombinations/tc_global_uniform_crossover.rb +90 -0
- data/test/operators/meta_operators/tc_conditional_combined_operator.rb +66 -0
- data/test/operators/meta_operators/tc_proportional_combined_operator.rb +167 -0
- data/test/operators/meta_operators/tc_sequential_combined_operator.rb +98 -0
- data/test/operators/mutations/tc_binary_mutation.rb +73 -0
- data/test/operators/mutations/tc_efficient_binary_mutation.rb +73 -0
- data/test/operators/mutations/tc_exchange_mutation.rb +127 -0
- data/test/operators/mutations/tc_gauss_mutation.rb +130 -0
- data/test/operators/mutations/tc_identity_mutation.rb +64 -0
- data/test/operators/mutations/tc_inversion_mutation.rb +70 -0
- data/test/operators/mutations/tc_mixing_mutation.rb +73 -0
- data/test/operators/mutations/tc_one_gene_flipping.rb +109 -0
- data/test/operators/mutations/tc_self_adaptive_gauss_mutation.rb +72 -0
- data/test/operators/mutations/tc_shifting_muation.rb +73 -0
- data/test/operators/mutations/tc_uniform_real_mutation.rb +65 -0
- data/test/operators/recombinations/tc_arithmetic_crossover.rb +79 -0
- data/test/operators/recombinations/tc_edge_recombination.rb +76 -0
- data/test/operators/recombinations/tc_identity_recombination.rb +81 -0
- data/test/operators/recombinations/tc_k_point_crossover.rb +81 -0
- data/test/operators/recombinations/tc_one_point_crossover.rb +80 -0
- data/test/operators/recombinations/tc_ordered_recombination.rb +76 -0
- data/test/operators/recombinations/tc_partially_mapped_crossover.rb +91 -0
- data/test/operators/recombinations/tc_uniform_crossover.rb +84 -0
- data/test/operators/selections/tc_best_selection.rb +85 -0
- data/test/operators/selections/tc_fitness_proportional_selection.rb +78 -0
- data/test/operators/selections/tc_identity.rb +91 -0
- data/test/operators/selections/tc_n_stage_tournament.rb +78 -0
- data/test/operators/selections/tc_random_selection.rb +70 -0
- data/test/operators/selections/tc_roulette_wheel_selection.rb +78 -0
- data/test/operators/selections/tc_tournament_selection.rb +83 -0
- data/test/problems/tc_binary_benchmark_functions.rb +126 -0
- data/test/problems/tc_float_benchmark_functions.rb +100 -0
- data/test/test_util/test_helper.rb +128 -0
- data/test/ts_adjustments.rb +26 -0
- data/test/ts_core.rb +29 -0
- data/test/ts_decoder.rb +26 -0
- data/test/ts_global_recombinations.rb +26 -0
- data/test/ts_meta_operators.rb +27 -0
- data/test/ts_mutations.rb +35 -0
- data/test/ts_problems.rb +26 -0
- data/test/ts_recombinations.rb +32 -0
- data/test/ts_selections.rb +31 -0
- data/testdata/README +4 -0
- data/testdata/bays29.tsp +68 -0
- data/testdata/myciel4.col +77 -0
- metadata +552 -0
@@ -0,0 +1,469 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
+
<head>
|
5
|
+
<title>Module: EvoSynth::Evolvers [EvoSynth Documentation]</title>
|
6
|
+
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
7
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
8
|
+
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
9
|
+
<script type="text/javascript">
|
10
|
+
// <![CDATA[
|
11
|
+
|
12
|
+
function popupCode( url ) {
|
13
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
14
|
+
}
|
15
|
+
|
16
|
+
function toggleCode( id ) {
|
17
|
+
if ( document.getElementById )
|
18
|
+
elem = document.getElementById( id );
|
19
|
+
else if ( document.all )
|
20
|
+
elem = eval( "document.all." + id );
|
21
|
+
else
|
22
|
+
return false;
|
23
|
+
|
24
|
+
elemStyle = elem.style;
|
25
|
+
|
26
|
+
if ( elemStyle.display != "block" ) {
|
27
|
+
elemStyle.display = "block"
|
28
|
+
} else {
|
29
|
+
elemStyle.display = "none"
|
30
|
+
}
|
31
|
+
|
32
|
+
return true;
|
33
|
+
}
|
34
|
+
|
35
|
+
// Make codeblocks hidden by default
|
36
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }<\/style>" )
|
37
|
+
|
38
|
+
// ]]>
|
39
|
+
</script>
|
40
|
+
|
41
|
+
</head>
|
42
|
+
<body>
|
43
|
+
|
44
|
+
|
45
|
+
<div id="classHeader">
|
46
|
+
<table class="header-table">
|
47
|
+
<tr class="top-aligned-row">
|
48
|
+
<td><strong>Module</strong></td>
|
49
|
+
<td class="class-name-in-header">EvoSynth::Evolvers</td>
|
50
|
+
</tr>
|
51
|
+
<tr class="top-aligned-row">
|
52
|
+
<td><strong>In:</strong></td>
|
53
|
+
<td>
|
54
|
+
|
55
|
+
|
56
|
+
<a href="../../files/lib/evosynth/evolvers/coevolutionary/round_robin_coevolutionary_rb.html">
|
57
|
+
|
58
|
+
lib/evosynth/evolvers/coevolutionary/round_robin_coevolutionary.rb
|
59
|
+
|
60
|
+
</a>
|
61
|
+
|
62
|
+
|
63
|
+
<br />
|
64
|
+
|
65
|
+
|
66
|
+
<a href="../../files/lib/evosynth/evolvers/coevolutionary/balanced_coevolutionary_rb.html">
|
67
|
+
|
68
|
+
lib/evosynth/evolvers/coevolutionary/balanced_coevolutionary.rb
|
69
|
+
|
70
|
+
</a>
|
71
|
+
|
72
|
+
|
73
|
+
<br />
|
74
|
+
|
75
|
+
|
76
|
+
<a href="../../files/lib/evosynth/evolvers/local_search/local_search_rb.html">
|
77
|
+
|
78
|
+
lib/evosynth/evolvers/local_search/local_search.rb
|
79
|
+
|
80
|
+
</a>
|
81
|
+
|
82
|
+
|
83
|
+
<br />
|
84
|
+
|
85
|
+
|
86
|
+
<a href="../../files/lib/evosynth/evolvers/local_search/acceptance_record_to_record_rb.html">
|
87
|
+
|
88
|
+
lib/evosynth/evolvers/local_search/acceptance_record_to_record.rb
|
89
|
+
|
90
|
+
</a>
|
91
|
+
|
92
|
+
|
93
|
+
<br />
|
94
|
+
|
95
|
+
|
96
|
+
<a href="../../files/lib/evosynth/evolvers/local_search/acceptance_threshold_rb.html">
|
97
|
+
|
98
|
+
lib/evosynth/evolvers/local_search/acceptance_threshold.rb
|
99
|
+
|
100
|
+
</a>
|
101
|
+
|
102
|
+
|
103
|
+
<br />
|
104
|
+
|
105
|
+
|
106
|
+
<a href="../../files/lib/evosynth/evolvers/local_search/acceptance_hillclimber_rb.html">
|
107
|
+
|
108
|
+
lib/evosynth/evolvers/local_search/acceptance_hillclimber.rb
|
109
|
+
|
110
|
+
</a>
|
111
|
+
|
112
|
+
|
113
|
+
<br />
|
114
|
+
|
115
|
+
|
116
|
+
<a href="../../files/lib/evosynth/evolvers/local_search/acceptance_great_deluge_rb.html">
|
117
|
+
|
118
|
+
lib/evosynth/evolvers/local_search/acceptance_great_deluge.rb
|
119
|
+
|
120
|
+
</a>
|
121
|
+
|
122
|
+
|
123
|
+
<br />
|
124
|
+
|
125
|
+
|
126
|
+
<a href="../../files/lib/evosynth/evolvers/local_search/acceptance_simulated_annealing_rb.html">
|
127
|
+
|
128
|
+
lib/evosynth/evolvers/local_search/acceptance_simulated_annealing.rb
|
129
|
+
|
130
|
+
</a>
|
131
|
+
|
132
|
+
|
133
|
+
<br />
|
134
|
+
|
135
|
+
|
136
|
+
<a href="../../files/lib/evosynth/evolvers/evolution_strategies/derandomized_es_rb.html">
|
137
|
+
|
138
|
+
lib/evosynth/evolvers/evolution_strategies/derandomized_es.rb
|
139
|
+
|
140
|
+
</a>
|
141
|
+
|
142
|
+
|
143
|
+
<br />
|
144
|
+
|
145
|
+
|
146
|
+
<a href="../../files/lib/evosynth/evolvers/evolution_strategies/adaptive_es_rb.html">
|
147
|
+
|
148
|
+
lib/evosynth/evolvers/evolution_strategies/adaptive_es.rb
|
149
|
+
|
150
|
+
</a>
|
151
|
+
|
152
|
+
|
153
|
+
<br />
|
154
|
+
|
155
|
+
|
156
|
+
<a href="../../files/lib/evosynth/evolvers/evolution_strategies/selfadaptive_es_rb.html">
|
157
|
+
|
158
|
+
lib/evosynth/evolvers/evolution_strategies/selfadaptive_es.rb
|
159
|
+
|
160
|
+
</a>
|
161
|
+
|
162
|
+
|
163
|
+
<br />
|
164
|
+
|
165
|
+
|
166
|
+
<a href="../../files/lib/evosynth/evolvers/runnable_evolver_rb.html">
|
167
|
+
|
168
|
+
lib/evosynth/evolvers/runnable_evolver.rb
|
169
|
+
|
170
|
+
</a>
|
171
|
+
|
172
|
+
|
173
|
+
<br />
|
174
|
+
|
175
|
+
|
176
|
+
<a href="../../files/lib/evosynth/evolvers/evolver_rb.html">
|
177
|
+
|
178
|
+
lib/evosynth/evolvers/evolver.rb
|
179
|
+
|
180
|
+
</a>
|
181
|
+
|
182
|
+
|
183
|
+
<br />
|
184
|
+
|
185
|
+
|
186
|
+
<a href="../../files/lib/evosynth/evolvers/profile_using_evolver_rb.html">
|
187
|
+
|
188
|
+
lib/evosynth/evolvers/profile_using_evolver.rb
|
189
|
+
|
190
|
+
</a>
|
191
|
+
|
192
|
+
|
193
|
+
<br />
|
194
|
+
|
195
|
+
|
196
|
+
<a href="../../files/lib/evosynth/evolvers/basic/steady_state_ga_rb.html">
|
197
|
+
|
198
|
+
lib/evosynth/evolvers/basic/steady_state_ga.rb
|
199
|
+
|
200
|
+
</a>
|
201
|
+
|
202
|
+
|
203
|
+
<br />
|
204
|
+
|
205
|
+
|
206
|
+
<a href="../../files/lib/evosynth/evolvers/basic/memetic_algorithm_rb.html">
|
207
|
+
|
208
|
+
lib/evosynth/evolvers/basic/memetic_algorithm.rb
|
209
|
+
|
210
|
+
</a>
|
211
|
+
|
212
|
+
|
213
|
+
<br />
|
214
|
+
|
215
|
+
|
216
|
+
<a href="../../files/lib/evosynth/evolvers/basic/population_hillclimber_rb.html">
|
217
|
+
|
218
|
+
lib/evosynth/evolvers/basic/population_hillclimber.rb
|
219
|
+
|
220
|
+
</a>
|
221
|
+
|
222
|
+
|
223
|
+
<br />
|
224
|
+
|
225
|
+
|
226
|
+
<a href="../../files/lib/evosynth/evolvers/basic/genetic_algorithm_rb.html">
|
227
|
+
|
228
|
+
lib/evosynth/evolvers/basic/genetic_algorithm.rb
|
229
|
+
|
230
|
+
</a>
|
231
|
+
|
232
|
+
|
233
|
+
<br />
|
234
|
+
|
235
|
+
|
236
|
+
<a href="../../files/lib/evosynth/evolvers/basic/hillclimber_rb.html">
|
237
|
+
|
238
|
+
lib/evosynth/evolvers/basic/hillclimber.rb
|
239
|
+
|
240
|
+
</a>
|
241
|
+
|
242
|
+
|
243
|
+
<br />
|
244
|
+
|
245
|
+
|
246
|
+
<a href="../../files/lib/evosynth/evolvers/elitism_rb.html">
|
247
|
+
|
248
|
+
lib/evosynth/evolvers/elitism.rb
|
249
|
+
|
250
|
+
</a>
|
251
|
+
|
252
|
+
|
253
|
+
<br />
|
254
|
+
|
255
|
+
</td>
|
256
|
+
</tr>
|
257
|
+
|
258
|
+
|
259
|
+
</table>
|
260
|
+
</div>
|
261
|
+
<!-- banner header -->
|
262
|
+
|
263
|
+
<div id="bodyContent">
|
264
|
+
|
265
|
+
<div id="contextContent">
|
266
|
+
|
267
|
+
</div>
|
268
|
+
|
269
|
+
|
270
|
+
<div id="method-list">
|
271
|
+
<h3 class="section-bar">Methods</h3>
|
272
|
+
|
273
|
+
<div class="name-list">
|
274
|
+
|
275
|
+
<a href="#M000125">add_strong_elistism</a>
|
276
|
+
|
277
|
+
<a href="#M000124">add_weak_elistism</a>
|
278
|
+
|
279
|
+
</div>
|
280
|
+
</div>
|
281
|
+
|
282
|
+
</div>
|
283
|
+
|
284
|
+
<!-- if includes -->
|
285
|
+
|
286
|
+
<div id="section">
|
287
|
+
|
288
|
+
<div id="class-list">
|
289
|
+
<h3 class="section-bar">Classes and Modules</h3>
|
290
|
+
|
291
|
+
Module <a href="Evolvers/Evolver.html" class="link">EvoSynth::Evolvers::Evolver</a><br />
|
292
|
+
Module <a href="Evolvers/ProfileUsingEvolver.html" class="link">EvoSynth::Evolvers::ProfileUsingEvolver</a><br />
|
293
|
+
Module <a href="Evolvers/RunnableEvolver.html" class="link">EvoSynth::Evolvers::RunnableEvolver</a><br />
|
294
|
+
Class <a href="Evolvers/AdaptiveES.html" class="link">EvoSynth::Evolvers::AdaptiveES</a><br />
|
295
|
+
Class <a href="Evolvers/BalancedCoevolutionary.html" class="link">EvoSynth::Evolvers::BalancedCoevolutionary</a><br />
|
296
|
+
Class <a href="Evolvers/DerandomizedES.html" class="link">EvoSynth::Evolvers::DerandomizedES</a><br />
|
297
|
+
Class <a href="Evolvers/GeneticAlgorithm.html" class="link">EvoSynth::Evolvers::GeneticAlgorithm</a><br />
|
298
|
+
Class <a href="Evolvers/Hillclimber.html" class="link">EvoSynth::Evolvers::Hillclimber</a><br />
|
299
|
+
Class <a href="Evolvers/LocalSearch.html" class="link">EvoSynth::Evolvers::LocalSearch</a><br />
|
300
|
+
Class <a href="Evolvers/MemeticAlgorithm.html" class="link">EvoSynth::Evolvers::MemeticAlgorithm</a><br />
|
301
|
+
Class <a href="Evolvers/PopulationHillclimber.html" class="link">EvoSynth::Evolvers::PopulationHillclimber</a><br />
|
302
|
+
Class <a href="Evolvers/RoundRobinCoevolutionary.html" class="link">EvoSynth::Evolvers::RoundRobinCoevolutionary</a><br />
|
303
|
+
Class <a href="Evolvers/SelfAdaptiveES.html" class="link">EvoSynth::Evolvers::SelfAdaptiveES</a><br />
|
304
|
+
Class <a href="Evolvers/SteadyStateGA.html" class="link">EvoSynth::Evolvers::SteadyStateGA</a><br />
|
305
|
+
|
306
|
+
</div>
|
307
|
+
|
308
|
+
|
309
|
+
|
310
|
+
|
311
|
+
<!-- if method_list -->
|
312
|
+
|
313
|
+
<div id="methods">
|
314
|
+
|
315
|
+
<h3 class="section-bar">Public Class methods</h3>
|
316
|
+
|
317
|
+
|
318
|
+
<div id="method-M000125" class="method-detail">
|
319
|
+
<a name="M000125"></a>
|
320
|
+
|
321
|
+
<div class="method-heading">
|
322
|
+
|
323
|
+
<a href="#M000125" class="method-signature">
|
324
|
+
|
325
|
+
<span class="method-name">add_strong_elistism</span><span class="method-args">(evolver, n = 1)</span>
|
326
|
+
|
327
|
+
</a>
|
328
|
+
|
329
|
+
</div>
|
330
|
+
|
331
|
+
<div class="method-description">
|
332
|
+
|
333
|
+
<p>
|
334
|
+
this function adds weak elistism to a evolver using instance_eval
|
335
|
+
</p>
|
336
|
+
<p>
|
337
|
+
strong elitism: copy best n parents into offspring population (replace
|
338
|
+
worst n childrens)
|
339
|
+
</p>
|
340
|
+
<p>
|
341
|
+
TODO: add some elegance to this code ;-)
|
342
|
+
</p>
|
343
|
+
|
344
|
+
<p><a class="source-toggle" href="#"
|
345
|
+
onclick="toggleCode('M000125-source');return false;">[Source]</a></p>
|
346
|
+
<div class="method-source-code" id="M000125-source">
|
347
|
+
<pre>
|
348
|
+
<span class="ruby-comment cmt"># File lib/evosynth/evolvers/elitism.rb, line 65</span>
|
349
|
+
65: <span class="ruby-keyword kw">def</span> <span class="ruby-constant">Evolvers</span>.<span class="ruby-identifier">add_strong_elistism</span>(<span class="ruby-identifier">evolver</span>, <span class="ruby-identifier">n</span> = <span class="ruby-value">1</span>)
|
350
|
+
66: <span class="ruby-identifier">evolver</span>.<span class="ruby-identifier">population</span> <span class="ruby-keyword kw">rescue</span> <span class="ruby-identifier">raise</span> <span class="ruby-value str">"Evolver not supported!"</span>
|
351
|
+
67:
|
352
|
+
68: <span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">n</span> <span class="ruby-operator">==</span> <span class="ruby-value">1</span>)
|
353
|
+
69: <span class="ruby-identifier">evolver</span>.<span class="ruby-identifier">instance_eval</span>(<span class="ruby-value str">"
|
354
|
+
70: alias :original_next_generation :next_generation
|
355
|
+
71: alias :original_to_s :to_s
|
356
|
+
72:
|
357
|
+
73: def next_generation
|
358
|
+
74: best = population.best
|
359
|
+
75:
|
360
|
+
76: original_next_generation
|
361
|
+
77:
|
362
|
+
78: population.remove(population.worst)
|
363
|
+
79: population.add(best)
|
364
|
+
80: end
|
365
|
+
81:
|
366
|
+
82: def to_s
|
367
|
+
83: '<< strong elitism >> ' + original_to_s
|
368
|
+
84: end
|
369
|
+
85: "</span>)
|
370
|
+
86: <span class="ruby-keyword kw">else</span>
|
371
|
+
87: <span class="ruby-identifier">evolver</span>.<span class="ruby-identifier">instance_eval</span>(<span class="ruby-node">"
|
372
|
+
88: alias :original_next_generation :next_generation
|
373
|
+
89: alias :original_to_s :to_s
|
374
|
+
90:
|
375
|
+
91: def next_generation
|
376
|
+
92: best = population.best(#{n})
|
377
|
+
93:
|
378
|
+
94: original_next_generation
|
379
|
+
95:
|
380
|
+
96: worst = population.worst(#{n})
|
381
|
+
97: worst.each { |individual| population.remove(individual) }
|
382
|
+
98: best.each { |individual| population.add(individual) }
|
383
|
+
99: end
|
384
|
+
100:
|
385
|
+
101: def to_s
|
386
|
+
102: '<< strong elitism >> ' + original_to_s
|
387
|
+
103: end
|
388
|
+
104: "</span>)
|
389
|
+
105: <span class="ruby-keyword kw">end</span>
|
390
|
+
106: <span class="ruby-keyword kw">end</span>
|
391
|
+
</pre>
|
392
|
+
</div>
|
393
|
+
|
394
|
+
</div>
|
395
|
+
</div>
|
396
|
+
|
397
|
+
|
398
|
+
<div id="method-M000124" class="method-detail">
|
399
|
+
<a name="M000124"></a>
|
400
|
+
|
401
|
+
<div class="method-heading">
|
402
|
+
|
403
|
+
<a href="#M000124" class="method-signature">
|
404
|
+
|
405
|
+
<span class="method-name">add_weak_elistism</span><span class="method-args">(evolver)</span>
|
406
|
+
|
407
|
+
</a>
|
408
|
+
|
409
|
+
</div>
|
410
|
+
|
411
|
+
<div class="method-description">
|
412
|
+
|
413
|
+
<p>
|
414
|
+
this function adds weak elistism to a evolver using instance_eval
|
415
|
+
</p>
|
416
|
+
<p>
|
417
|
+
weak elitism: if fitness of childrens decreased, replace worst individual
|
418
|
+
with best parent
|
419
|
+
</p>
|
420
|
+
|
421
|
+
<p><a class="source-toggle" href="#"
|
422
|
+
onclick="toggleCode('M000124-source');return false;">[Source]</a></p>
|
423
|
+
<div class="method-source-code" id="M000124-source">
|
424
|
+
<pre>
|
425
|
+
<span class="ruby-comment cmt"># File lib/evosynth/evolvers/elitism.rb, line 35</span>
|
426
|
+
35: <span class="ruby-keyword kw">def</span> <span class="ruby-constant">Evolvers</span>.<span class="ruby-identifier">add_weak_elistism</span>(<span class="ruby-identifier">evolver</span>)
|
427
|
+
36: <span class="ruby-identifier">evolver</span>.<span class="ruby-identifier">population</span> <span class="ruby-keyword kw">rescue</span> <span class="ruby-identifier">raise</span> <span class="ruby-value str">"Evolver not supported!"</span>
|
428
|
+
37:
|
429
|
+
38: <span class="ruby-identifier">evolver</span>.<span class="ruby-identifier">instance_eval</span>(<span class="ruby-value str">%q{
|
430
|
+
39: alias :original_next_generation :next_generation
|
431
|
+
40: alias :original_to_s :to_s
|
432
|
+
41:
|
433
|
+
42: def next_generation
|
434
|
+
43: best_individual = population.best
|
435
|
+
44:
|
436
|
+
45: original_next_generation
|
437
|
+
46:
|
438
|
+
47: if population.best < best_individual
|
439
|
+
48: population.remove(population.worst)
|
440
|
+
49: population.add(best_individual)
|
441
|
+
50: end
|
442
|
+
51: end
|
443
|
+
52:
|
444
|
+
53: def to_s
|
445
|
+
54: "<< weak elitism >> " + original_to_s
|
446
|
+
55: end
|
447
|
+
56: }</span>)
|
448
|
+
57: <span class="ruby-keyword kw">end</span>
|
449
|
+
</pre>
|
450
|
+
</div>
|
451
|
+
|
452
|
+
</div>
|
453
|
+
</div>
|
454
|
+
|
455
|
+
|
456
|
+
|
457
|
+
</div>
|
458
|
+
|
459
|
+
|
460
|
+
|
461
|
+
|
462
|
+
</div>
|
463
|
+
|
464
|
+
<div id="validator-badges">
|
465
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
466
|
+
</div>
|
467
|
+
|
468
|
+
</body>
|
469
|
+
</html>
|