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,336 @@
|
|
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>Class: EvoSynth::Mutations::BinaryMutation [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>Class</strong></td>
|
49
|
+
<td class="class-name-in-header">EvoSynth::Mutations::BinaryMutation</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/operators/mutations/binary_mutation_rb.html">
|
57
|
+
|
58
|
+
lib/evosynth/operators/mutations/binary_mutation.rb
|
59
|
+
|
60
|
+
</a>
|
61
|
+
|
62
|
+
|
63
|
+
<br />
|
64
|
+
|
65
|
+
</td>
|
66
|
+
</tr>
|
67
|
+
|
68
|
+
|
69
|
+
<tr class="top-aligned-row">
|
70
|
+
<td><strong>Parent:</strong></td>
|
71
|
+
<td>
|
72
|
+
|
73
|
+
Object
|
74
|
+
|
75
|
+
</td>
|
76
|
+
</tr>
|
77
|
+
|
78
|
+
</table>
|
79
|
+
</div>
|
80
|
+
<!-- banner header -->
|
81
|
+
|
82
|
+
<div id="bodyContent">
|
83
|
+
|
84
|
+
<div id="contextContent">
|
85
|
+
|
86
|
+
<div id="description">
|
87
|
+
<p>
|
88
|
+
This mutations flips each gene in the genome of a given individual using
|
89
|
+
the given flip function (a lambda) with a given probability and returns a
|
90
|
+
mutated individual. To use this mutation the flip_function has to return
|
91
|
+
the negation/inverse of a given gene. This mutations is based on
|
92
|
+
BINAERE-MUTATION (Weicker 2007, page 59).
|
93
|
+
</p>
|
94
|
+
|
95
|
+
</div>
|
96
|
+
|
97
|
+
</div>
|
98
|
+
|
99
|
+
|
100
|
+
<div id="method-list">
|
101
|
+
<h3 class="section-bar">Methods</h3>
|
102
|
+
|
103
|
+
<div class="name-list">
|
104
|
+
|
105
|
+
<a href="#M000065">mutate</a>
|
106
|
+
|
107
|
+
<a href="#M000064">new</a>
|
108
|
+
|
109
|
+
<a href="#M000066">to_s</a>
|
110
|
+
|
111
|
+
</div>
|
112
|
+
</div>
|
113
|
+
|
114
|
+
</div>
|
115
|
+
|
116
|
+
<!-- if includes -->
|
117
|
+
|
118
|
+
<div id="section">
|
119
|
+
|
120
|
+
<div id="constants-list">
|
121
|
+
<h3 class="section-bar">Constants</h3>
|
122
|
+
|
123
|
+
<div class="name-list">
|
124
|
+
<table summary="Constants">
|
125
|
+
|
126
|
+
<tr class="top-aligned-row context-row">
|
127
|
+
<td class="context-item-name">DEFAULT_PROBABILITY</td>
|
128
|
+
<td>=</td>
|
129
|
+
<td class="context-item-value">0.1</td>
|
130
|
+
|
131
|
+
<td> </td>
|
132
|
+
<td class="context-item-desc">
|
133
|
+
the default mutation probability
|
134
|
+
|
135
|
+
</td>
|
136
|
+
|
137
|
+
</tr>
|
138
|
+
|
139
|
+
</table>
|
140
|
+
</div>
|
141
|
+
</div>
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
<div id="attribute-list">
|
146
|
+
<h3 class="section-bar">Attributes</h3>
|
147
|
+
|
148
|
+
<div class="name-list">
|
149
|
+
<table>
|
150
|
+
|
151
|
+
<tr class="top-aligned-row context-row">
|
152
|
+
<td class="context-item-name">flip_function</td>
|
153
|
+
|
154
|
+
<td class="context-item-value"> [RW] </td>
|
155
|
+
|
156
|
+
<td class="context-item-desc">
|
157
|
+
This function (lambda) is used to flip each gene
|
158
|
+
|
159
|
+
</td>
|
160
|
+
</tr>
|
161
|
+
|
162
|
+
<tr class="top-aligned-row context-row">
|
163
|
+
<td class="context-item-name">probability</td>
|
164
|
+
|
165
|
+
<td class="context-item-value"> [RW] </td>
|
166
|
+
|
167
|
+
<td class="context-item-desc">
|
168
|
+
Each gene is flipped with this probability (should be between 0 and 1)
|
169
|
+
|
170
|
+
</td>
|
171
|
+
</tr>
|
172
|
+
|
173
|
+
</table>
|
174
|
+
</div>
|
175
|
+
</div>
|
176
|
+
|
177
|
+
|
178
|
+
<!-- if method_list -->
|
179
|
+
|
180
|
+
<div id="methods">
|
181
|
+
|
182
|
+
<h3 class="section-bar">Public Class methods</h3>
|
183
|
+
|
184
|
+
|
185
|
+
<div id="method-M000064" class="method-detail">
|
186
|
+
<a name="M000064"></a>
|
187
|
+
|
188
|
+
<div class="method-heading">
|
189
|
+
|
190
|
+
<a href="#M000064" class="method-signature">
|
191
|
+
|
192
|
+
<span class="method-name">BinaryMutation.new(Lambda) → BinaryMutation<br />
|
193
|
+
BinaryMutation.new(Lambda, Float) → BinaryMutation (overrides default probability)<br />
|
194
|
+
</span>
|
195
|
+
|
196
|
+
</a>
|
197
|
+
|
198
|
+
</div>
|
199
|
+
|
200
|
+
<div class="method-description">
|
201
|
+
|
202
|
+
<p>
|
203
|
+
Returns a new <a href="BinaryMutation.html">BinaryMutation</a>. In the
|
204
|
+
first form, the default mutation probability
|
205
|
+
BinaryMutation::DEFAULT_PROBABILITY (0.1) is used. In the second it creates
|
206
|
+
a <a href="BinaryMutation.html">BinaryMutation</a> with the given
|
207
|
+
probability.
|
208
|
+
</p>
|
209
|
+
<pre>
|
210
|
+
custom_flip_function = lambda { |gene| EvoSynth.rand(42 * gene) }
|
211
|
+
BinaryMutation.new(custom_flip_function)
|
212
|
+
BinaryMutation.new(EvoSynth::Mutations::Functions::FLIP_BOOLEAN, 0.01)
|
213
|
+
</pre>
|
214
|
+
|
215
|
+
<p><a class="source-toggle" href="#"
|
216
|
+
onclick="toggleCode('M000064-source');return false;">[Source]</a></p>
|
217
|
+
<div class="method-source-code" id="M000064-source">
|
218
|
+
<pre>
|
219
|
+
<span class="ruby-comment cmt"># File lib/evosynth/operators/mutations/binary_mutation.rb, line 57</span>
|
220
|
+
57: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">flip_function</span>, <span class="ruby-identifier">probability</span> = <span class="ruby-constant">DEFAULT_PROBABILITY</span>)
|
221
|
+
58: <span class="ruby-ivar">@flip_function</span> = <span class="ruby-identifier">flip_function</span>
|
222
|
+
59: <span class="ruby-ivar">@probability</span> = <span class="ruby-identifier">probability</span>
|
223
|
+
60: <span class="ruby-keyword kw">end</span>
|
224
|
+
</pre>
|
225
|
+
</div>
|
226
|
+
|
227
|
+
</div>
|
228
|
+
</div>
|
229
|
+
|
230
|
+
|
231
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
232
|
+
|
233
|
+
|
234
|
+
<div id="method-M000065" class="method-detail">
|
235
|
+
<a name="M000065"></a>
|
236
|
+
|
237
|
+
<div class="method-heading">
|
238
|
+
|
239
|
+
<a href="#M000065" class="method-signature">
|
240
|
+
|
241
|
+
<span class="method-name">mutate(Individual) → Individual<br />
|
242
|
+
</span>
|
243
|
+
|
244
|
+
</a>
|
245
|
+
|
246
|
+
</div>
|
247
|
+
|
248
|
+
<div class="method-description">
|
249
|
+
|
250
|
+
<p>
|
251
|
+
Returns the mutation (with the given flip function) of a given individual.
|
252
|
+
</p>
|
253
|
+
<pre>
|
254
|
+
m = BinaryMutation.new
|
255
|
+
m.mutate(a_individual) #=> a_new_individual
|
256
|
+
</pre>
|
257
|
+
|
258
|
+
<p><a class="source-toggle" href="#"
|
259
|
+
onclick="toggleCode('M000065-source');return false;">[Source]</a></p>
|
260
|
+
<div class="method-source-code" id="M000065-source">
|
261
|
+
<pre>
|
262
|
+
<span class="ruby-comment cmt"># File lib/evosynth/operators/mutations/binary_mutation.rb, line 70</span>
|
263
|
+
70: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">mutate</span>(<span class="ruby-identifier">individual</span>)
|
264
|
+
71: <span class="ruby-identifier">mutated</span> = <span class="ruby-identifier">individual</span>.<span class="ruby-identifier">deep_clone</span>
|
265
|
+
72: <span class="ruby-identifier">genome</span> = <span class="ruby-identifier">mutated</span>.<span class="ruby-identifier">genome</span>
|
266
|
+
73:
|
267
|
+
74: <span class="ruby-identifier">genome</span>.<span class="ruby-identifier">size</span>.<span class="ruby-identifier">times</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">index</span><span class="ruby-operator">|</span>
|
268
|
+
75: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@flip_function</span>.<span class="ruby-identifier">arity</span> <span class="ruby-operator">==</span> <span class="ruby-value">1</span>
|
269
|
+
76: <span class="ruby-identifier">genome</span>[<span class="ruby-identifier">index</span>] = <span class="ruby-ivar">@flip_function</span>.<span class="ruby-identifier">call</span>(<span class="ruby-identifier">genome</span>[<span class="ruby-identifier">index</span>]) <span class="ruby-keyword kw">if</span> <span class="ruby-constant">EvoSynth</span>.<span class="ruby-identifier">rand</span> <span class="ruby-operator"><=</span> <span class="ruby-ivar">@probability</span>
|
270
|
+
77: <span class="ruby-keyword kw">else</span>
|
271
|
+
78: <span class="ruby-identifier">genome</span>[<span class="ruby-identifier">index</span>] = <span class="ruby-ivar">@flip_function</span>.<span class="ruby-identifier">call</span> <span class="ruby-keyword kw">if</span> <span class="ruby-constant">EvoSynth</span>.<span class="ruby-identifier">rand</span> <span class="ruby-operator"><=</span> <span class="ruby-ivar">@probability</span>
|
272
|
+
79: <span class="ruby-keyword kw">end</span>
|
273
|
+
80: <span class="ruby-keyword kw">end</span>
|
274
|
+
81:
|
275
|
+
82: <span class="ruby-identifier">mutated</span>
|
276
|
+
83: <span class="ruby-keyword kw">end</span>
|
277
|
+
</pre>
|
278
|
+
</div>
|
279
|
+
|
280
|
+
</div>
|
281
|
+
</div>
|
282
|
+
|
283
|
+
|
284
|
+
<div id="method-M000066" class="method-detail">
|
285
|
+
<a name="M000066"></a>
|
286
|
+
|
287
|
+
<div class="method-heading">
|
288
|
+
|
289
|
+
<a href="#M000066" class="method-signature">
|
290
|
+
|
291
|
+
<span class="method-name">to_s → string<br />
|
292
|
+
</span>
|
293
|
+
|
294
|
+
</a>
|
295
|
+
|
296
|
+
</div>
|
297
|
+
|
298
|
+
<div class="method-description">
|
299
|
+
|
300
|
+
<p>
|
301
|
+
Returns description of this mutation
|
302
|
+
</p>
|
303
|
+
<pre>
|
304
|
+
m = BinaryMutation.new(0.01)
|
305
|
+
m.to_s #=> "binary mutation <probability: 0.01>"
|
306
|
+
</pre>
|
307
|
+
|
308
|
+
<p><a class="source-toggle" href="#"
|
309
|
+
onclick="toggleCode('M000066-source');return false;">[Source]</a></p>
|
310
|
+
<div class="method-source-code" id="M000066-source">
|
311
|
+
<pre>
|
312
|
+
<span class="ruby-comment cmt"># File lib/evosynth/operators/mutations/binary_mutation.rb, line 93</span>
|
313
|
+
93: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_s</span>
|
314
|
+
94: <span class="ruby-node">"binary mutation <probability: #{@probability}>"</span>
|
315
|
+
95: <span class="ruby-keyword kw">end</span>
|
316
|
+
</pre>
|
317
|
+
</div>
|
318
|
+
|
319
|
+
</div>
|
320
|
+
</div>
|
321
|
+
|
322
|
+
|
323
|
+
|
324
|
+
</div>
|
325
|
+
|
326
|
+
|
327
|
+
|
328
|
+
|
329
|
+
</div>
|
330
|
+
|
331
|
+
<div id="validator-badges">
|
332
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
333
|
+
</div>
|
334
|
+
|
335
|
+
</body>
|
336
|
+
</html>
|
@@ -0,0 +1,345 @@
|
|
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>Class: EvoSynth::Mutations::EfficientBinaryMutation [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>Class</strong></td>
|
49
|
+
<td class="class-name-in-header">EvoSynth::Mutations::EfficientBinaryMutation</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/operators/mutations/efficient_binary_mutation_rb.html">
|
57
|
+
|
58
|
+
lib/evosynth/operators/mutations/efficient_binary_mutation.rb
|
59
|
+
|
60
|
+
</a>
|
61
|
+
|
62
|
+
|
63
|
+
<br />
|
64
|
+
|
65
|
+
</td>
|
66
|
+
</tr>
|
67
|
+
|
68
|
+
|
69
|
+
<tr class="top-aligned-row">
|
70
|
+
<td><strong>Parent:</strong></td>
|
71
|
+
<td>
|
72
|
+
|
73
|
+
Object
|
74
|
+
|
75
|
+
</td>
|
76
|
+
</tr>
|
77
|
+
|
78
|
+
</table>
|
79
|
+
</div>
|
80
|
+
<!-- banner header -->
|
81
|
+
|
82
|
+
<div id="bodyContent">
|
83
|
+
|
84
|
+
<div id="contextContent">
|
85
|
+
|
86
|
+
<div id="description">
|
87
|
+
<p>
|
88
|
+
This mutation is basically a optimized version of the <a
|
89
|
+
href="BinaryMutation.html">BinaryMutation</a> and should have a better
|
90
|
+
performance on long genomes.
|
91
|
+
</p>
|
92
|
+
<p>
|
93
|
+
It flips each gene in the genome of a given individual using the given flip
|
94
|
+
function (a lambda) with a given probability and returns a mutated
|
95
|
+
individual. To use this mutation the flip_function has to return the
|
96
|
+
negation/inverse of a given gene. This mutations is based on
|
97
|
+
EFFIZIENTE-BINAERE-MUTATION (Weicker 2007, page 130).
|
98
|
+
</p>
|
99
|
+
|
100
|
+
</div>
|
101
|
+
|
102
|
+
</div>
|
103
|
+
|
104
|
+
|
105
|
+
<div id="method-list">
|
106
|
+
<h3 class="section-bar">Methods</h3>
|
107
|
+
|
108
|
+
<div class="name-list">
|
109
|
+
|
110
|
+
<a href="#M000087">mutate</a>
|
111
|
+
|
112
|
+
<a href="#M000086">new</a>
|
113
|
+
|
114
|
+
<a href="#M000088">to_s</a>
|
115
|
+
|
116
|
+
</div>
|
117
|
+
</div>
|
118
|
+
|
119
|
+
</div>
|
120
|
+
|
121
|
+
<!-- if includes -->
|
122
|
+
|
123
|
+
<div id="section">
|
124
|
+
|
125
|
+
<div id="constants-list">
|
126
|
+
<h3 class="section-bar">Constants</h3>
|
127
|
+
|
128
|
+
<div class="name-list">
|
129
|
+
<table summary="Constants">
|
130
|
+
|
131
|
+
<tr class="top-aligned-row context-row">
|
132
|
+
<td class="context-item-name">DEFAULT_PROBABILITY</td>
|
133
|
+
<td>=</td>
|
134
|
+
<td class="context-item-value">0.1</td>
|
135
|
+
|
136
|
+
<td> </td>
|
137
|
+
<td class="context-item-desc">
|
138
|
+
the default mutation probability
|
139
|
+
|
140
|
+
</td>
|
141
|
+
|
142
|
+
</tr>
|
143
|
+
|
144
|
+
</table>
|
145
|
+
</div>
|
146
|
+
</div>
|
147
|
+
|
148
|
+
|
149
|
+
|
150
|
+
<div id="attribute-list">
|
151
|
+
<h3 class="section-bar">Attributes</h3>
|
152
|
+
|
153
|
+
<div class="name-list">
|
154
|
+
<table>
|
155
|
+
|
156
|
+
<tr class="top-aligned-row context-row">
|
157
|
+
<td class="context-item-name">flip_function</td>
|
158
|
+
|
159
|
+
<td class="context-item-value"> [RW] </td>
|
160
|
+
|
161
|
+
<td class="context-item-desc">
|
162
|
+
This function is used to flip each gene
|
163
|
+
|
164
|
+
</td>
|
165
|
+
</tr>
|
166
|
+
|
167
|
+
<tr class="top-aligned-row context-row">
|
168
|
+
<td class="context-item-name">probability</td>
|
169
|
+
|
170
|
+
<td class="context-item-value"> [RW] </td>
|
171
|
+
|
172
|
+
<td class="context-item-desc">
|
173
|
+
Each gene is flipped with this probability (should be between 0 and 1)
|
174
|
+
|
175
|
+
</td>
|
176
|
+
</tr>
|
177
|
+
|
178
|
+
</table>
|
179
|
+
</div>
|
180
|
+
</div>
|
181
|
+
|
182
|
+
|
183
|
+
<!-- if method_list -->
|
184
|
+
|
185
|
+
<div id="methods">
|
186
|
+
|
187
|
+
<h3 class="section-bar">Public Class methods</h3>
|
188
|
+
|
189
|
+
|
190
|
+
<div id="method-M000086" class="method-detail">
|
191
|
+
<a name="M000086"></a>
|
192
|
+
|
193
|
+
<div class="method-heading">
|
194
|
+
|
195
|
+
<a href="#M000086" class="method-signature">
|
196
|
+
|
197
|
+
<span class="method-name">EfficientBinaryMutation.new(Lambda) → EfficientBinaryMutation<br />
|
198
|
+
EfficientBinaryMutation.new(Lambda, Float) → EfficientBinaryMutation (overrides default probability)<br />
|
199
|
+
</span>
|
200
|
+
|
201
|
+
</a>
|
202
|
+
|
203
|
+
</div>
|
204
|
+
|
205
|
+
<div class="method-description">
|
206
|
+
|
207
|
+
<p>
|
208
|
+
Returns a new <a
|
209
|
+
href="EfficientBinaryMutation.html">EfficientBinaryMutation</a>. In the
|
210
|
+
first form, the default mutation probability
|
211
|
+
BinaryMutation::DEFAULT_PROBABILITY (0.1) is used. In the second it creates
|
212
|
+
a <a href="BinaryMutation.html">BinaryMutation</a> with the given
|
213
|
+
probability.
|
214
|
+
</p>
|
215
|
+
<pre>
|
216
|
+
custom_flip_function = lambda { |gene| EvoSynth.rand(42 * gene) }
|
217
|
+
EfficientBinaryMutation.new(custom_flip_function)
|
218
|
+
EfficientBinaryMutation.new(EvoSynth::Mutations::Functions::FLIP_BOOLEAN, 0.01)
|
219
|
+
</pre>
|
220
|
+
|
221
|
+
<p><a class="source-toggle" href="#"
|
222
|
+
onclick="toggleCode('M000086-source');return false;">[Source]</a></p>
|
223
|
+
<div class="method-source-code" id="M000086-source">
|
224
|
+
<pre>
|
225
|
+
<span class="ruby-comment cmt"># File lib/evosynth/operators/mutations/efficient_binary_mutation.rb, line 59</span>
|
226
|
+
59: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">flip_function</span>, <span class="ruby-identifier">probability</span> = <span class="ruby-constant">DEFAULT_PROBABILITY</span>)
|
227
|
+
60: <span class="ruby-ivar">@flip_function</span> = <span class="ruby-identifier">flip_function</span>
|
228
|
+
61: <span class="ruby-ivar">@probability</span> = <span class="ruby-identifier">probability</span>
|
229
|
+
62: <span class="ruby-keyword kw">end</span>
|
230
|
+
</pre>
|
231
|
+
</div>
|
232
|
+
|
233
|
+
</div>
|
234
|
+
</div>
|
235
|
+
|
236
|
+
|
237
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
238
|
+
|
239
|
+
|
240
|
+
<div id="method-M000087" class="method-detail">
|
241
|
+
<a name="M000087"></a>
|
242
|
+
|
243
|
+
<div class="method-heading">
|
244
|
+
|
245
|
+
<a href="#M000087" class="method-signature">
|
246
|
+
|
247
|
+
<span class="method-name">mutate(Individual) → Individual<br />
|
248
|
+
</span>
|
249
|
+
|
250
|
+
</a>
|
251
|
+
|
252
|
+
</div>
|
253
|
+
|
254
|
+
<div class="method-description">
|
255
|
+
|
256
|
+
<p>
|
257
|
+
Returns the mutation (with the given flip function) of a given individual.
|
258
|
+
</p>
|
259
|
+
<pre>
|
260
|
+
m = EfficientBinaryMutation.new
|
261
|
+
m.mutate(a_individual) #=> a_new_individual
|
262
|
+
</pre>
|
263
|
+
|
264
|
+
<p><a class="source-toggle" href="#"
|
265
|
+
onclick="toggleCode('M000087-source');return false;">[Source]</a></p>
|
266
|
+
<div class="method-source-code" id="M000087-source">
|
267
|
+
<pre>
|
268
|
+
<span class="ruby-comment cmt"># File lib/evosynth/operators/mutations/efficient_binary_mutation.rb, line 72</span>
|
269
|
+
72: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">mutate</span>(<span class="ruby-identifier">individual</span>)
|
270
|
+
73: <span class="ruby-identifier">mutated</span> = <span class="ruby-identifier">individual</span>.<span class="ruby-identifier">deep_clone</span>
|
271
|
+
74: <span class="ruby-ivar">@next_index</span> = <span class="ruby-constant">EvoSynth</span>.<span class="ruby-identifier">rand</span>(<span class="ruby-identifier">mutated</span>.<span class="ruby-identifier">genome</span>.<span class="ruby-identifier">size</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-keyword kw">defined?</span> <span class="ruby-ivar">@next_index</span>
|
272
|
+
75:
|
273
|
+
76: <span class="ruby-keyword kw">while</span> <span class="ruby-ivar">@next_index</span> <span class="ruby-operator"><</span> <span class="ruby-identifier">mutated</span>.<span class="ruby-identifier">genome</span>.<span class="ruby-identifier">size</span>
|
274
|
+
77: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@flip_function</span>.<span class="ruby-identifier">arity</span> <span class="ruby-operator">==</span> <span class="ruby-value">1</span>
|
275
|
+
78: <span class="ruby-identifier">mutated</span>.<span class="ruby-identifier">genome</span>[<span class="ruby-ivar">@next_index</span>] = <span class="ruby-ivar">@flip_function</span>.<span class="ruby-identifier">call</span>(<span class="ruby-identifier">mutated</span>.<span class="ruby-identifier">genome</span>[<span class="ruby-ivar">@next_index</span>])
|
276
|
+
79: <span class="ruby-keyword kw">else</span>
|
277
|
+
80: <span class="ruby-identifier">mutated</span>.<span class="ruby-identifier">genome</span>[<span class="ruby-ivar">@next_index</span>] = <span class="ruby-ivar">@flip_function</span>.<span class="ruby-identifier">call</span>
|
278
|
+
81: <span class="ruby-keyword kw">end</span>
|
279
|
+
82:
|
280
|
+
83: <span class="ruby-ivar">@next_index</span> <span class="ruby-operator">+=</span> (<span class="ruby-constant">Math</span>.<span class="ruby-identifier">log</span>(<span class="ruby-constant">EvoSynth</span>.<span class="ruby-identifier">rand</span>) <span class="ruby-operator">/</span> <span class="ruby-constant">Math</span>.<span class="ruby-identifier">log</span>(<span class="ruby-value">1</span> <span class="ruby-operator">-</span> <span class="ruby-ivar">@probability</span>)).<span class="ruby-identifier">ceil</span>
|
281
|
+
84: <span class="ruby-keyword kw">end</span>
|
282
|
+
85:
|
283
|
+
86: <span class="ruby-ivar">@next_index</span> <span class="ruby-operator">-=</span> <span class="ruby-identifier">mutated</span>.<span class="ruby-identifier">genome</span>.<span class="ruby-identifier">size</span>
|
284
|
+
87: <span class="ruby-identifier">mutated</span>
|
285
|
+
88: <span class="ruby-keyword kw">end</span>
|
286
|
+
</pre>
|
287
|
+
</div>
|
288
|
+
|
289
|
+
</div>
|
290
|
+
</div>
|
291
|
+
|
292
|
+
|
293
|
+
<div id="method-M000088" class="method-detail">
|
294
|
+
<a name="M000088"></a>
|
295
|
+
|
296
|
+
<div class="method-heading">
|
297
|
+
|
298
|
+
<a href="#M000088" class="method-signature">
|
299
|
+
|
300
|
+
<span class="method-name">to_s → string<br />
|
301
|
+
</span>
|
302
|
+
|
303
|
+
</a>
|
304
|
+
|
305
|
+
</div>
|
306
|
+
|
307
|
+
<div class="method-description">
|
308
|
+
|
309
|
+
<p>
|
310
|
+
Returns description of this mutation
|
311
|
+
</p>
|
312
|
+
<pre>
|
313
|
+
m = EfficientBinaryMutation.new(0.91)
|
314
|
+
m.to_s #=> "efficient binary muation <probability: 0.01>"
|
315
|
+
</pre>
|
316
|
+
|
317
|
+
<p><a class="source-toggle" href="#"
|
318
|
+
onclick="toggleCode('M000088-source');return false;">[Source]</a></p>
|
319
|
+
<div class="method-source-code" id="M000088-source">
|
320
|
+
<pre>
|
321
|
+
<span class="ruby-comment cmt"># File lib/evosynth/operators/mutations/efficient_binary_mutation.rb, line 98</span>
|
322
|
+
98: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_s</span>
|
323
|
+
99: <span class="ruby-node">"efficient binary muation <probability: #{@probability}>"</span>
|
324
|
+
100: <span class="ruby-keyword kw">end</span>
|
325
|
+
</pre>
|
326
|
+
</div>
|
327
|
+
|
328
|
+
</div>
|
329
|
+
</div>
|
330
|
+
|
331
|
+
|
332
|
+
|
333
|
+
</div>
|
334
|
+
|
335
|
+
|
336
|
+
|
337
|
+
|
338
|
+
</div>
|
339
|
+
|
340
|
+
<div id="validator-badges">
|
341
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
342
|
+
</div>
|
343
|
+
|
344
|
+
</body>
|
345
|
+
</html>
|