evosynth 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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,448 @@
|
|
|
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::Evolvers::AdaptiveES [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::Evolvers::AdaptiveES</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/evolution_strategies/adaptive_es_rb.html">
|
|
57
|
+
|
|
58
|
+
lib/evosynth/evolvers/evolution_strategies/adaptive_es.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
|
+
ES-ADAPTIV (Weicker Page 135)
|
|
89
|
+
</p>
|
|
90
|
+
<p>
|
|
91
|
+
TODO: rdoc (mutation and adjustment are fixed!)
|
|
92
|
+
</p>
|
|
93
|
+
|
|
94
|
+
</div>
|
|
95
|
+
|
|
96
|
+
</div>
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
<div id="method-list">
|
|
100
|
+
<h3 class="section-bar">Methods</h3>
|
|
101
|
+
|
|
102
|
+
<div class="name-list">
|
|
103
|
+
|
|
104
|
+
<a href="#M000173">best_solution</a>
|
|
105
|
+
|
|
106
|
+
<a href="#M000171">new</a>
|
|
107
|
+
|
|
108
|
+
<a href="#M000176">next_generation</a>
|
|
109
|
+
|
|
110
|
+
<a href="#M000175">return_result</a>
|
|
111
|
+
|
|
112
|
+
<a href="#M000172">to_s</a>
|
|
113
|
+
|
|
114
|
+
<a href="#M000174">worst_solution</a>
|
|
115
|
+
|
|
116
|
+
</div>
|
|
117
|
+
</div>
|
|
118
|
+
|
|
119
|
+
</div>
|
|
120
|
+
|
|
121
|
+
<!-- if includes -->
|
|
122
|
+
|
|
123
|
+
<div id="includes">
|
|
124
|
+
<h3 class="section-bar">Included Modules</h3>
|
|
125
|
+
|
|
126
|
+
<div id="includes-list">
|
|
127
|
+
|
|
128
|
+
<span class="include-name"><a href="Evolver.html">EvoSynth::Evolvers::Evolver</a></span>
|
|
129
|
+
|
|
130
|
+
</div>
|
|
131
|
+
</div>
|
|
132
|
+
|
|
133
|
+
<div id="section">
|
|
134
|
+
|
|
135
|
+
<div id="constants-list">
|
|
136
|
+
<h3 class="section-bar">Constants</h3>
|
|
137
|
+
|
|
138
|
+
<div class="name-list">
|
|
139
|
+
<table summary="Constants">
|
|
140
|
+
|
|
141
|
+
<tr class="top-aligned-row context-row">
|
|
142
|
+
<td class="context-item-name">DEFAULT_SIGMA</td>
|
|
143
|
+
<td>=</td>
|
|
144
|
+
<td class="context-item-value">0.1</td>
|
|
145
|
+
|
|
146
|
+
</tr>
|
|
147
|
+
|
|
148
|
+
<tr class="top-aligned-row context-row">
|
|
149
|
+
<td class="context-item-name">DEFAULT_CHILD_FACTOR</td>
|
|
150
|
+
<td>=</td>
|
|
151
|
+
<td class="context-item-value">5</td>
|
|
152
|
+
|
|
153
|
+
</tr>
|
|
154
|
+
|
|
155
|
+
<tr class="top-aligned-row context-row">
|
|
156
|
+
<td class="context-item-name">DEFAULT_MODIFICATION_FREQUENCY</td>
|
|
157
|
+
<td>=</td>
|
|
158
|
+
<td class="context-item-value">10</td>
|
|
159
|
+
|
|
160
|
+
</tr>
|
|
161
|
+
|
|
162
|
+
<tr class="top-aligned-row context-row">
|
|
163
|
+
<td class="context-item-name">DEFAULT_MUTATION</td>
|
|
164
|
+
<td>=</td>
|
|
165
|
+
<td class="context-item-value">EvoSynth::Mutations::GaussMutation.new(DEFAULT_SIGMA)</td>
|
|
166
|
+
|
|
167
|
+
</tr>
|
|
168
|
+
|
|
169
|
+
<tr class="top-aligned-row context-row">
|
|
170
|
+
<td class="context-item-name">DEFAULT_PARENT_SELECTION</td>
|
|
171
|
+
<td>=</td>
|
|
172
|
+
<td class="context-item-value">EvoSynth::Selections::RandomSelection.new</td>
|
|
173
|
+
|
|
174
|
+
</tr>
|
|
175
|
+
|
|
176
|
+
<tr class="top-aligned-row context-row">
|
|
177
|
+
<td class="context-item-name">DEFAULT_ENV_SELECTION</td>
|
|
178
|
+
<td>=</td>
|
|
179
|
+
<td class="context-item-value">EvoSynth::Selections::SelectBest.new</td>
|
|
180
|
+
|
|
181
|
+
</tr>
|
|
182
|
+
|
|
183
|
+
<tr class="top-aligned-row context-row">
|
|
184
|
+
<td class="context-item-name">DEFAULT_ADJUSTMENT</td>
|
|
185
|
+
<td>=</td>
|
|
186
|
+
<td class="context-item-value">EvoSynth::Adjustments::AdaptiveAdjustment.new</td>
|
|
187
|
+
|
|
188
|
+
</tr>
|
|
189
|
+
|
|
190
|
+
</table>
|
|
191
|
+
</div>
|
|
192
|
+
</div>
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
<div id="attribute-list">
|
|
197
|
+
<h3 class="section-bar">Attributes</h3>
|
|
198
|
+
|
|
199
|
+
<div class="name-list">
|
|
200
|
+
<table>
|
|
201
|
+
|
|
202
|
+
<tr class="top-aligned-row context-row">
|
|
203
|
+
<td class="context-item-name">success</td>
|
|
204
|
+
|
|
205
|
+
<td class="context-item-value"> [R] </td>
|
|
206
|
+
|
|
207
|
+
<td class="context-item-desc"></td>
|
|
208
|
+
</tr>
|
|
209
|
+
|
|
210
|
+
</table>
|
|
211
|
+
</div>
|
|
212
|
+
</div>
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
<!-- if method_list -->
|
|
216
|
+
|
|
217
|
+
<div id="methods">
|
|
218
|
+
|
|
219
|
+
<h3 class="section-bar">Public Class methods</h3>
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
<div id="method-M000171" class="method-detail">
|
|
223
|
+
<a name="M000171"></a>
|
|
224
|
+
|
|
225
|
+
<div class="method-heading">
|
|
226
|
+
|
|
227
|
+
<a href="#M000171" class="method-signature">
|
|
228
|
+
|
|
229
|
+
<span class="method-name">new</span><span class="method-args">(profile)</span>
|
|
230
|
+
|
|
231
|
+
</a>
|
|
232
|
+
|
|
233
|
+
</div>
|
|
234
|
+
|
|
235
|
+
<div class="method-description">
|
|
236
|
+
|
|
237
|
+
<p><a class="source-toggle" href="#"
|
|
238
|
+
onclick="toggleCode('M000171-source');return false;">[Source]</a></p>
|
|
239
|
+
<div class="method-source-code" id="M000171-source">
|
|
240
|
+
<pre>
|
|
241
|
+
<span class="ruby-comment cmt"># File lib/evosynth/evolvers/evolution_strategies/adaptive_es.rb, line 48</span>
|
|
242
|
+
48: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">profile</span>)
|
|
243
|
+
49: <span class="ruby-identifier">init_profile</span> <span class="ruby-identifier">:population</span>,
|
|
244
|
+
50: <span class="ruby-identifier">:evaluator</span>,
|
|
245
|
+
51: <span class="ruby-identifier">:sigma</span> =<span class="ruby-operator">></span> <span class="ruby-constant">DEFAULT_SIGMA</span>,
|
|
246
|
+
52: <span class="ruby-identifier">:child_factor</span> =<span class="ruby-operator">></span> <span class="ruby-constant">DEFAULT_CHILD_FACTOR</span>,
|
|
247
|
+
53: <span class="ruby-identifier">:modification_frequency</span> =<span class="ruby-operator">></span> <span class="ruby-constant">DEFAULT_MODIFICATION_FREQUENCY</span>,
|
|
248
|
+
54: <span class="ruby-identifier">:enviromental_selection</span> =<span class="ruby-operator">></span> <span class="ruby-constant">DEFAULT_ENV_SELECTION</span>,
|
|
249
|
+
55: <span class="ruby-identifier">:parent_selection</span> =<span class="ruby-operator">></span> <span class="ruby-constant">DEFAULT_PARENT_SELECTION</span>
|
|
250
|
+
56:
|
|
251
|
+
57: <span class="ruby-identifier">use_profile</span> <span class="ruby-identifier">profile</span>
|
|
252
|
+
58: <span class="ruby-ivar">@adjustment</span> = <span class="ruby-constant">DEFAULT_ADJUSTMENT</span>
|
|
253
|
+
59: <span class="ruby-ivar">@mutation</span> = <span class="ruby-constant">DEFAULT_MUTATION</span>
|
|
254
|
+
60: <span class="ruby-ivar">@success</span> = <span class="ruby-value">0</span>
|
|
255
|
+
61:
|
|
256
|
+
62: <span class="ruby-ivar">@population</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">individual</span><span class="ruby-operator">|</span> <span class="ruby-ivar">@evaluator</span>.<span class="ruby-identifier">calculate_and_set_initial_fitness</span>(<span class="ruby-identifier">individual</span>) }
|
|
257
|
+
63: <span class="ruby-keyword kw">end</span>
|
|
258
|
+
</pre>
|
|
259
|
+
</div>
|
|
260
|
+
|
|
261
|
+
</div>
|
|
262
|
+
</div>
|
|
263
|
+
|
|
264
|
+
|
|
265
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
|
266
|
+
|
|
267
|
+
|
|
268
|
+
<div id="method-M000173" class="method-detail">
|
|
269
|
+
<a name="M000173"></a>
|
|
270
|
+
|
|
271
|
+
<div class="method-heading">
|
|
272
|
+
|
|
273
|
+
<a href="#M000173" class="method-signature">
|
|
274
|
+
|
|
275
|
+
<span class="method-name">best_solution</span><span class="method-args">()</span>
|
|
276
|
+
|
|
277
|
+
</a>
|
|
278
|
+
|
|
279
|
+
</div>
|
|
280
|
+
|
|
281
|
+
<div class="method-description">
|
|
282
|
+
|
|
283
|
+
<p><a class="source-toggle" href="#"
|
|
284
|
+
onclick="toggleCode('M000173-source');return false;">[Source]</a></p>
|
|
285
|
+
<div class="method-source-code" id="M000173-source">
|
|
286
|
+
<pre>
|
|
287
|
+
<span class="ruby-comment cmt"># File lib/evosynth/evolvers/evolution_strategies/adaptive_es.rb, line 69</span>
|
|
288
|
+
69: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">best_solution</span>
|
|
289
|
+
70: <span class="ruby-ivar">@population</span>.<span class="ruby-identifier">best</span>
|
|
290
|
+
71: <span class="ruby-keyword kw">end</span>
|
|
291
|
+
</pre>
|
|
292
|
+
</div>
|
|
293
|
+
|
|
294
|
+
</div>
|
|
295
|
+
</div>
|
|
296
|
+
|
|
297
|
+
|
|
298
|
+
<div id="method-M000176" class="method-detail">
|
|
299
|
+
<a name="M000176"></a>
|
|
300
|
+
|
|
301
|
+
<div class="method-heading">
|
|
302
|
+
|
|
303
|
+
<a href="#M000176" class="method-signature">
|
|
304
|
+
|
|
305
|
+
<span class="method-name">next_generation</span><span class="method-args">()</span>
|
|
306
|
+
|
|
307
|
+
</a>
|
|
308
|
+
|
|
309
|
+
</div>
|
|
310
|
+
|
|
311
|
+
<div class="method-description">
|
|
312
|
+
|
|
313
|
+
<p><a class="source-toggle" href="#"
|
|
314
|
+
onclick="toggleCode('M000176-source');return false;">[Source]</a></p>
|
|
315
|
+
<div class="method-source-code" id="M000176-source">
|
|
316
|
+
<pre>
|
|
317
|
+
<span class="ruby-comment cmt"># File lib/evosynth/evolvers/evolution_strategies/adaptive_es.rb, line 81</span>
|
|
318
|
+
81: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">next_generation</span>
|
|
319
|
+
82: <span class="ruby-identifier">child_population</span> = <span class="ruby-constant">EvoSynth</span><span class="ruby-operator">::</span><span class="ruby-constant">Population</span>.<span class="ruby-identifier">new</span>
|
|
320
|
+
83:
|
|
321
|
+
84: (<span class="ruby-ivar">@child_factor</span> <span class="ruby-operator">*</span> <span class="ruby-ivar">@population</span>.<span class="ruby-identifier">size</span>).<span class="ruby-identifier">times</span> <span class="ruby-keyword kw">do</span>
|
|
322
|
+
85: <span class="ruby-identifier">parent</span> = <span class="ruby-ivar">@parent_selection</span>.<span class="ruby-identifier">select</span>(<span class="ruby-ivar">@population</span>, <span class="ruby-value">1</span>).<span class="ruby-identifier">first</span>
|
|
323
|
+
86: <span class="ruby-ivar">@mutation</span>.<span class="ruby-identifier">sigma</span> = <span class="ruby-ivar">@sigma</span>
|
|
324
|
+
87: <span class="ruby-identifier">child</span> = <span class="ruby-ivar">@mutation</span>.<span class="ruby-identifier">mutate</span>(<span class="ruby-identifier">parent</span>)
|
|
325
|
+
88:
|
|
326
|
+
89: <span class="ruby-ivar">@evaluator</span>.<span class="ruby-identifier">calculate_and_set_fitness</span>(<span class="ruby-identifier">child</span>)
|
|
327
|
+
90: <span class="ruby-ivar">@success</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">child</span> <span class="ruby-operator">></span> <span class="ruby-identifier">parent</span>
|
|
328
|
+
91: <span class="ruby-identifier">child_population</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">child</span>
|
|
329
|
+
92: <span class="ruby-keyword kw">end</span>
|
|
330
|
+
93:
|
|
331
|
+
94: <span class="ruby-ivar">@population</span> = <span class="ruby-ivar">@enviromental_selection</span>.<span class="ruby-identifier">select</span>(<span class="ruby-identifier">child_population</span>, <span class="ruby-ivar">@population</span>.<span class="ruby-identifier">size</span>)
|
|
332
|
+
95: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@generations_computed</span> <span class="ruby-operator">%</span> <span class="ruby-ivar">@modification_frequency</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
|
|
333
|
+
96: <span class="ruby-identifier">success_rate</span> = <span class="ruby-ivar">@success</span> <span class="ruby-operator">/</span> (<span class="ruby-ivar">@modification_frequency</span> <span class="ruby-operator">-</span> (<span class="ruby-ivar">@child_factor</span> <span class="ruby-operator">*</span> <span class="ruby-ivar">@population</span>.<span class="ruby-identifier">size</span>))
|
|
334
|
+
97: <span class="ruby-ivar">@sigma</span> = <span class="ruby-ivar">@adjustment</span>.<span class="ruby-identifier">adjust</span>(<span class="ruby-ivar">@sigma</span>, <span class="ruby-identifier">success_rate</span>)
|
|
335
|
+
98: <span class="ruby-ivar">@success</span> = <span class="ruby-value">0</span>
|
|
336
|
+
99: <span class="ruby-keyword kw">end</span>
|
|
337
|
+
100: <span class="ruby-keyword kw">end</span>
|
|
338
|
+
</pre>
|
|
339
|
+
</div>
|
|
340
|
+
|
|
341
|
+
</div>
|
|
342
|
+
</div>
|
|
343
|
+
|
|
344
|
+
|
|
345
|
+
<div id="method-M000175" class="method-detail">
|
|
346
|
+
<a name="M000175"></a>
|
|
347
|
+
|
|
348
|
+
<div class="method-heading">
|
|
349
|
+
|
|
350
|
+
<a href="#M000175" class="method-signature">
|
|
351
|
+
|
|
352
|
+
<span class="method-name">return_result</span><span class="method-args">()</span>
|
|
353
|
+
|
|
354
|
+
</a>
|
|
355
|
+
|
|
356
|
+
</div>
|
|
357
|
+
|
|
358
|
+
<div class="method-description">
|
|
359
|
+
|
|
360
|
+
<p><a class="source-toggle" href="#"
|
|
361
|
+
onclick="toggleCode('M000175-source');return false;">[Source]</a></p>
|
|
362
|
+
<div class="method-source-code" id="M000175-source">
|
|
363
|
+
<pre>
|
|
364
|
+
<span class="ruby-comment cmt"># File lib/evosynth/evolvers/evolution_strategies/adaptive_es.rb, line 77</span>
|
|
365
|
+
77: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">return_result</span>
|
|
366
|
+
78: <span class="ruby-ivar">@population</span>
|
|
367
|
+
79: <span class="ruby-keyword kw">end</span>
|
|
368
|
+
</pre>
|
|
369
|
+
</div>
|
|
370
|
+
|
|
371
|
+
</div>
|
|
372
|
+
</div>
|
|
373
|
+
|
|
374
|
+
|
|
375
|
+
<div id="method-M000172" class="method-detail">
|
|
376
|
+
<a name="M000172"></a>
|
|
377
|
+
|
|
378
|
+
<div class="method-heading">
|
|
379
|
+
|
|
380
|
+
<a href="#M000172" class="method-signature">
|
|
381
|
+
|
|
382
|
+
<span class="method-name">to_s</span><span class="method-args">()</span>
|
|
383
|
+
|
|
384
|
+
</a>
|
|
385
|
+
|
|
386
|
+
</div>
|
|
387
|
+
|
|
388
|
+
<div class="method-description">
|
|
389
|
+
|
|
390
|
+
<p><a class="source-toggle" href="#"
|
|
391
|
+
onclick="toggleCode('M000172-source');return false;">[Source]</a></p>
|
|
392
|
+
<div class="method-source-code" id="M000172-source">
|
|
393
|
+
<pre>
|
|
394
|
+
<span class="ruby-comment cmt"># File lib/evosynth/evolvers/evolution_strategies/adaptive_es.rb, line 65</span>
|
|
395
|
+
65: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_s</span>
|
|
396
|
+
66: <span class="ruby-node">"adaptive ES <sigma: #{@sigma}, success: #{@success}, mutation: #{@mutation}, parent selection: #{@parent_selection}, enviromental selection: #{@enviromental_selection}>"</span>
|
|
397
|
+
67: <span class="ruby-keyword kw">end</span>
|
|
398
|
+
</pre>
|
|
399
|
+
</div>
|
|
400
|
+
|
|
401
|
+
</div>
|
|
402
|
+
</div>
|
|
403
|
+
|
|
404
|
+
|
|
405
|
+
<div id="method-M000174" class="method-detail">
|
|
406
|
+
<a name="M000174"></a>
|
|
407
|
+
|
|
408
|
+
<div class="method-heading">
|
|
409
|
+
|
|
410
|
+
<a href="#M000174" class="method-signature">
|
|
411
|
+
|
|
412
|
+
<span class="method-name">worst_solution</span><span class="method-args">()</span>
|
|
413
|
+
|
|
414
|
+
</a>
|
|
415
|
+
|
|
416
|
+
</div>
|
|
417
|
+
|
|
418
|
+
<div class="method-description">
|
|
419
|
+
|
|
420
|
+
<p><a class="source-toggle" href="#"
|
|
421
|
+
onclick="toggleCode('M000174-source');return false;">[Source]</a></p>
|
|
422
|
+
<div class="method-source-code" id="M000174-source">
|
|
423
|
+
<pre>
|
|
424
|
+
<span class="ruby-comment cmt"># File lib/evosynth/evolvers/evolution_strategies/adaptive_es.rb, line 73</span>
|
|
425
|
+
73: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">worst_solution</span>
|
|
426
|
+
74: <span class="ruby-ivar">@population</span>.<span class="ruby-identifier">worst</span>
|
|
427
|
+
75: <span class="ruby-keyword kw">end</span>
|
|
428
|
+
</pre>
|
|
429
|
+
</div>
|
|
430
|
+
|
|
431
|
+
</div>
|
|
432
|
+
</div>
|
|
433
|
+
|
|
434
|
+
|
|
435
|
+
|
|
436
|
+
</div>
|
|
437
|
+
|
|
438
|
+
|
|
439
|
+
|
|
440
|
+
|
|
441
|
+
</div>
|
|
442
|
+
|
|
443
|
+
<div id="validator-badges">
|
|
444
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
|
445
|
+
</div>
|
|
446
|
+
|
|
447
|
+
</body>
|
|
448
|
+
</html>
|
|
@@ -0,0 +1,439 @@
|
|
|
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::Evolvers::BalancedCoevolutionary [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::Evolvers::BalancedCoevolutionary</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/balanced_coevolutionary_rb.html">
|
|
57
|
+
|
|
58
|
+
lib/evosynth/evolvers/coevolutionary/balanced_coevolutionary.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
|
+
based on “Coevolution, Memory and Balance” from Paredis, 1999
|
|
89
|
+
</p>
|
|
90
|
+
<p>
|
|
91
|
+
evolves two populations (problems, solutions / predator, prey) in a
|
|
92
|
+
balanced manner
|
|
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="#M000141">best_solution</a>
|
|
106
|
+
|
|
107
|
+
<a href="#M000139">new</a>
|
|
108
|
+
|
|
109
|
+
<a href="#M000144">next_generation</a>
|
|
110
|
+
|
|
111
|
+
<a href="#M000143">return_result</a>
|
|
112
|
+
|
|
113
|
+
<a href="#M000140">to_s</a>
|
|
114
|
+
|
|
115
|
+
<a href="#M000142">worst_solution</a>
|
|
116
|
+
|
|
117
|
+
</div>
|
|
118
|
+
</div>
|
|
119
|
+
|
|
120
|
+
</div>
|
|
121
|
+
|
|
122
|
+
<!-- if includes -->
|
|
123
|
+
|
|
124
|
+
<div id="includes">
|
|
125
|
+
<h3 class="section-bar">Included Modules</h3>
|
|
126
|
+
|
|
127
|
+
<div id="includes-list">
|
|
128
|
+
|
|
129
|
+
<span class="include-name"><a href="Evolver.html">EvoSynth::Evolvers::Evolver</a></span>
|
|
130
|
+
|
|
131
|
+
</div>
|
|
132
|
+
</div>
|
|
133
|
+
|
|
134
|
+
<div id="section">
|
|
135
|
+
|
|
136
|
+
<div id="constants-list">
|
|
137
|
+
<h3 class="section-bar">Constants</h3>
|
|
138
|
+
|
|
139
|
+
<div class="name-list">
|
|
140
|
+
<table summary="Constants">
|
|
141
|
+
|
|
142
|
+
<tr class="top-aligned-row context-row">
|
|
143
|
+
<td class="context-item-name">DEFAULT_PAIRING_RUNS</td>
|
|
144
|
+
<td>=</td>
|
|
145
|
+
<td class="context-item-value">20</td>
|
|
146
|
+
|
|
147
|
+
</tr>
|
|
148
|
+
|
|
149
|
+
<tr class="top-aligned-row context-row">
|
|
150
|
+
<td class="context-item-name">DEFAULT_SELECTION</td>
|
|
151
|
+
<td>=</td>
|
|
152
|
+
<td class="context-item-value">EvoSynth::Selections::FitnessProportionalSelection.new</td>
|
|
153
|
+
|
|
154
|
+
</tr>
|
|
155
|
+
|
|
156
|
+
<tr class="top-aligned-row context-row">
|
|
157
|
+
<td class="context-item-name">DEFAULT_RECOMBINATION</td>
|
|
158
|
+
<td>=</td>
|
|
159
|
+
<td class="context-item-value">EvoSynth::Recombinations::KPointCrossover.new(2)</td>
|
|
160
|
+
|
|
161
|
+
</tr>
|
|
162
|
+
|
|
163
|
+
<tr class="top-aligned-row context-row">
|
|
164
|
+
<td class="context-item-name">DEFAULT_RECOMBINATION_PROBABILITY</td>
|
|
165
|
+
<td>=</td>
|
|
166
|
+
<td class="context-item-value">0.75</td>
|
|
167
|
+
|
|
168
|
+
</tr>
|
|
169
|
+
|
|
170
|
+
</table>
|
|
171
|
+
</div>
|
|
172
|
+
</div>
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
<div id="attribute-list">
|
|
177
|
+
<h3 class="section-bar">Attributes</h3>
|
|
178
|
+
|
|
179
|
+
<div class="name-list">
|
|
180
|
+
<table>
|
|
181
|
+
|
|
182
|
+
<tr class="top-aligned-row context-row">
|
|
183
|
+
<td class="context-item-name">solution_success</td>
|
|
184
|
+
|
|
185
|
+
<td class="context-item-value"> [R] </td>
|
|
186
|
+
|
|
187
|
+
<td class="context-item-desc"></td>
|
|
188
|
+
</tr>
|
|
189
|
+
|
|
190
|
+
</table>
|
|
191
|
+
</div>
|
|
192
|
+
</div>
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
<!-- if method_list -->
|
|
196
|
+
|
|
197
|
+
<div id="methods">
|
|
198
|
+
|
|
199
|
+
<h3 class="section-bar">Public Class methods</h3>
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
<div id="method-M000139" class="method-detail">
|
|
203
|
+
<a name="M000139"></a>
|
|
204
|
+
|
|
205
|
+
<div class="method-heading">
|
|
206
|
+
|
|
207
|
+
<a href="#M000139" class="method-signature">
|
|
208
|
+
|
|
209
|
+
<span class="method-name">new</span><span class="method-args">(profile)</span>
|
|
210
|
+
|
|
211
|
+
</a>
|
|
212
|
+
|
|
213
|
+
</div>
|
|
214
|
+
|
|
215
|
+
<div class="method-description">
|
|
216
|
+
|
|
217
|
+
<p><a class="source-toggle" href="#"
|
|
218
|
+
onclick="toggleCode('M000139-source');return false;">[Source]</a></p>
|
|
219
|
+
<div class="method-source-code" id="M000139-source">
|
|
220
|
+
<pre>
|
|
221
|
+
<span class="ruby-comment cmt"># File lib/evosynth/evolvers/coevolutionary/balanced_coevolutionary.rb, line 42</span>
|
|
222
|
+
42: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">profile</span>)
|
|
223
|
+
43: <span class="ruby-identifier">init_profile</span> <span class="ruby-identifier">:population</span>,
|
|
224
|
+
44: <span class="ruby-identifier">:problems</span>,
|
|
225
|
+
45: <span class="ruby-identifier">:evaluator</span>,
|
|
226
|
+
46: <span class="ruby-identifier">:mutation</span>,
|
|
227
|
+
47: <span class="ruby-identifier">:problem_mutation</span>,
|
|
228
|
+
48: <span class="ruby-identifier">:recombination</span> =<span class="ruby-operator">></span> <span class="ruby-constant">DEFAULT_RECOMBINATION</span>,
|
|
229
|
+
49: <span class="ruby-identifier">:problem_recombination</span> =<span class="ruby-operator">></span> <span class="ruby-constant">DEFAULT_RECOMBINATION</span>,
|
|
230
|
+
50: <span class="ruby-identifier">:parent_selection</span> =<span class="ruby-operator">></span> <span class="ruby-constant">DEFAULT_SELECTION</span>,
|
|
231
|
+
51: <span class="ruby-identifier">:enviromental_selection</span> =<span class="ruby-operator">></span> <span class="ruby-constant">DEFAULT_SELECTION</span>,
|
|
232
|
+
52: <span class="ruby-identifier">:pairing_runs</span> =<span class="ruby-operator">></span> <span class="ruby-constant">DEFAULT_PAIRING_RUNS</span>
|
|
233
|
+
53:
|
|
234
|
+
54: <span class="ruby-identifier">use_profile</span> <span class="ruby-identifier">profile</span>
|
|
235
|
+
55:
|
|
236
|
+
56: <span class="ruby-comment cmt"># intialize fitnesses?! FIXME: find a better way to do this</span>
|
|
237
|
+
57: <span class="ruby-identifier">solution</span> = <span class="ruby-ivar">@parent_selection</span>.<span class="ruby-identifier">select</span>(<span class="ruby-ivar">@population</span>, <span class="ruby-value">1</span>).<span class="ruby-identifier">first</span>
|
|
238
|
+
58: <span class="ruby-ivar">@problems</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">problem</span><span class="ruby-operator">|</span>
|
|
239
|
+
59: <span class="ruby-ivar">@evaluator</span>.<span class="ruby-identifier">encounter</span>(<span class="ruby-identifier">problem</span>, <span class="ruby-identifier">solution</span>)
|
|
240
|
+
60: <span class="ruby-keyword kw">end</span>
|
|
241
|
+
61:
|
|
242
|
+
62: <span class="ruby-identifier">problem</span> = <span class="ruby-ivar">@parent_selection</span>.<span class="ruby-identifier">select</span>(<span class="ruby-ivar">@problems</span>, <span class="ruby-value">1</span>).<span class="ruby-identifier">first</span>
|
|
243
|
+
63: <span class="ruby-ivar">@population</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">solution</span><span class="ruby-operator">|</span>
|
|
244
|
+
64: <span class="ruby-ivar">@evaluator</span>.<span class="ruby-identifier">encounter</span>(<span class="ruby-identifier">problem</span>, <span class="ruby-identifier">solution</span>)
|
|
245
|
+
65: <span class="ruby-keyword kw">end</span>
|
|
246
|
+
66: <span class="ruby-keyword kw">end</span>
|
|
247
|
+
</pre>
|
|
248
|
+
</div>
|
|
249
|
+
|
|
250
|
+
</div>
|
|
251
|
+
</div>
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
|
255
|
+
|
|
256
|
+
|
|
257
|
+
<div id="method-M000141" class="method-detail">
|
|
258
|
+
<a name="M000141"></a>
|
|
259
|
+
|
|
260
|
+
<div class="method-heading">
|
|
261
|
+
|
|
262
|
+
<a href="#M000141" class="method-signature">
|
|
263
|
+
|
|
264
|
+
<span class="method-name">best_solution</span><span class="method-args">()</span>
|
|
265
|
+
|
|
266
|
+
</a>
|
|
267
|
+
|
|
268
|
+
</div>
|
|
269
|
+
|
|
270
|
+
<div class="method-description">
|
|
271
|
+
|
|
272
|
+
<p><a class="source-toggle" href="#"
|
|
273
|
+
onclick="toggleCode('M000141-source');return false;">[Source]</a></p>
|
|
274
|
+
<div class="method-source-code" id="M000141-source">
|
|
275
|
+
<pre>
|
|
276
|
+
<span class="ruby-comment cmt"># File lib/evosynth/evolvers/coevolutionary/balanced_coevolutionary.rb, line 72</span>
|
|
277
|
+
72: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">best_solution</span>
|
|
278
|
+
73: <span class="ruby-ivar">@population</span>.<span class="ruby-identifier">best</span>
|
|
279
|
+
74: <span class="ruby-keyword kw">end</span>
|
|
280
|
+
</pre>
|
|
281
|
+
</div>
|
|
282
|
+
|
|
283
|
+
</div>
|
|
284
|
+
</div>
|
|
285
|
+
|
|
286
|
+
|
|
287
|
+
<div id="method-M000144" class="method-detail">
|
|
288
|
+
<a name="M000144"></a>
|
|
289
|
+
|
|
290
|
+
<div class="method-heading">
|
|
291
|
+
|
|
292
|
+
<a href="#M000144" class="method-signature">
|
|
293
|
+
|
|
294
|
+
<span class="method-name">next_generation</span><span class="method-args">()</span>
|
|
295
|
+
|
|
296
|
+
</a>
|
|
297
|
+
|
|
298
|
+
</div>
|
|
299
|
+
|
|
300
|
+
<div class="method-description">
|
|
301
|
+
|
|
302
|
+
<p><a class="source-toggle" href="#"
|
|
303
|
+
onclick="toggleCode('M000144-source');return false;">[Source]</a></p>
|
|
304
|
+
<div class="method-source-code" id="M000144-source">
|
|
305
|
+
<pre>
|
|
306
|
+
<span class="ruby-comment cmt"># File lib/evosynth/evolvers/coevolutionary/balanced_coevolutionary.rb, line 84</span>
|
|
307
|
+
84: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">next_generation</span>
|
|
308
|
+
85: <span class="ruby-identifier">problem_wins</span>, <span class="ruby-identifier">solution_wins</span> = <span class="ruby-value">0</span>, <span class="ruby-value">0</span>
|
|
309
|
+
86:
|
|
310
|
+
87: <span class="ruby-ivar">@pairing_runs</span>.<span class="ruby-identifier">times</span> <span class="ruby-keyword kw">do</span>
|
|
311
|
+
88: <span class="ruby-identifier">problem</span> = <span class="ruby-ivar">@parent_selection</span>.<span class="ruby-identifier">select</span>(<span class="ruby-ivar">@problems</span>, <span class="ruby-value">1</span>).<span class="ruby-identifier">first</span>
|
|
312
|
+
89: <span class="ruby-identifier">solution</span> = <span class="ruby-ivar">@parent_selection</span>.<span class="ruby-identifier">select</span>(<span class="ruby-ivar">@population</span>, <span class="ruby-value">1</span>).<span class="ruby-identifier">first</span>
|
|
313
|
+
90: <span class="ruby-identifier">winner</span> = <span class="ruby-ivar">@evaluator</span>.<span class="ruby-identifier">encounter</span>(<span class="ruby-identifier">problem</span>, <span class="ruby-identifier">solution</span>)
|
|
314
|
+
91: <span class="ruby-identifier">winner</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">problem</span> <span class="ruby-value">? </span><span class="ruby-identifier">problem_wins</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">solution_wins</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
|
|
315
|
+
92: <span class="ruby-keyword kw">end</span>
|
|
316
|
+
93:
|
|
317
|
+
94: <span class="ruby-ivar">@solution_success</span> = <span class="ruby-identifier">solution_wins</span> <span class="ruby-operator">/</span> <span class="ruby-ivar">@pairing_runs</span>.<span class="ruby-identifier">to_f</span>
|
|
318
|
+
95:
|
|
319
|
+
96: <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">@solution_success</span>
|
|
320
|
+
97: <span class="ruby-comment cmt"># select, recombine and mutate solution child</span>
|
|
321
|
+
98: <span class="ruby-identifier">evolve_offspring</span>(<span class="ruby-ivar">@population</span>, <span class="ruby-ivar">@problems</span>, <span class="ruby-ivar">@recombination</span>,
|
|
322
|
+
99: <span class="ruby-ivar">@mutation</span>) { <span class="ruby-operator">|</span><span class="ruby-identifier">child</span>, <span class="ruby-identifier">enemy</span><span class="ruby-operator">|</span> <span class="ruby-ivar">@evaluator</span>.<span class="ruby-identifier">encounter</span>(<span class="ruby-identifier">enemy</span>, <span class="ruby-identifier">child</span>, <span class="ruby-keyword kw">false</span>, <span class="ruby-keyword kw">true</span>) }
|
|
323
|
+
100: <span class="ruby-keyword kw">else</span>
|
|
324
|
+
101: <span class="ruby-comment cmt"># select, recombine and mutate problem child</span>
|
|
325
|
+
102: <span class="ruby-identifier">evolve_offspring</span>(<span class="ruby-ivar">@problems</span>, <span class="ruby-ivar">@population</span>, <span class="ruby-ivar">@problem_recombination</span>,
|
|
326
|
+
103: <span class="ruby-ivar">@problem_mutation</span>) { <span class="ruby-operator">|</span><span class="ruby-identifier">child</span>, <span class="ruby-identifier">enemy</span><span class="ruby-operator">|</span> <span class="ruby-ivar">@evaluator</span>.<span class="ruby-identifier">encounter</span>(<span class="ruby-identifier">child</span>, <span class="ruby-identifier">enemy</span>, <span class="ruby-keyword kw">true</span>, <span class="ruby-keyword kw">false</span>) }
|
|
327
|
+
104: <span class="ruby-keyword kw">end</span>
|
|
328
|
+
105: <span class="ruby-keyword kw">end</span>
|
|
329
|
+
</pre>
|
|
330
|
+
</div>
|
|
331
|
+
|
|
332
|
+
</div>
|
|
333
|
+
</div>
|
|
334
|
+
|
|
335
|
+
|
|
336
|
+
<div id="method-M000143" class="method-detail">
|
|
337
|
+
<a name="M000143"></a>
|
|
338
|
+
|
|
339
|
+
<div class="method-heading">
|
|
340
|
+
|
|
341
|
+
<a href="#M000143" class="method-signature">
|
|
342
|
+
|
|
343
|
+
<span class="method-name">return_result</span><span class="method-args">()</span>
|
|
344
|
+
|
|
345
|
+
</a>
|
|
346
|
+
|
|
347
|
+
</div>
|
|
348
|
+
|
|
349
|
+
<div class="method-description">
|
|
350
|
+
|
|
351
|
+
<p><a class="source-toggle" href="#"
|
|
352
|
+
onclick="toggleCode('M000143-source');return false;">[Source]</a></p>
|
|
353
|
+
<div class="method-source-code" id="M000143-source">
|
|
354
|
+
<pre>
|
|
355
|
+
<span class="ruby-comment cmt"># File lib/evosynth/evolvers/coevolutionary/balanced_coevolutionary.rb, line 80</span>
|
|
356
|
+
80: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">return_result</span>
|
|
357
|
+
81: <span class="ruby-ivar">@population</span>
|
|
358
|
+
82: <span class="ruby-keyword kw">end</span>
|
|
359
|
+
</pre>
|
|
360
|
+
</div>
|
|
361
|
+
|
|
362
|
+
</div>
|
|
363
|
+
</div>
|
|
364
|
+
|
|
365
|
+
|
|
366
|
+
<div id="method-M000140" class="method-detail">
|
|
367
|
+
<a name="M000140"></a>
|
|
368
|
+
|
|
369
|
+
<div class="method-heading">
|
|
370
|
+
|
|
371
|
+
<a href="#M000140" class="method-signature">
|
|
372
|
+
|
|
373
|
+
<span class="method-name">to_s</span><span class="method-args">()</span>
|
|
374
|
+
|
|
375
|
+
</a>
|
|
376
|
+
|
|
377
|
+
</div>
|
|
378
|
+
|
|
379
|
+
<div class="method-description">
|
|
380
|
+
|
|
381
|
+
<p><a class="source-toggle" href="#"
|
|
382
|
+
onclick="toggleCode('M000140-source');return false;">[Source]</a></p>
|
|
383
|
+
<div class="method-source-code" id="M000140-source">
|
|
384
|
+
<pre>
|
|
385
|
+
<span class="ruby-comment cmt"># File lib/evosynth/evolvers/coevolutionary/balanced_coevolutionary.rb, line 68</span>
|
|
386
|
+
68: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_s</span>
|
|
387
|
+
69: <span class="ruby-node">"C-M-B coevolutionary algorithm <mutation: #{@mutation}, recombination: #{@recombination}, parent selection: #{@parent_selection}, enviromental selection: #{@enviromental_selection}>"</span>
|
|
388
|
+
70: <span class="ruby-keyword kw">end</span>
|
|
389
|
+
</pre>
|
|
390
|
+
</div>
|
|
391
|
+
|
|
392
|
+
</div>
|
|
393
|
+
</div>
|
|
394
|
+
|
|
395
|
+
|
|
396
|
+
<div id="method-M000142" class="method-detail">
|
|
397
|
+
<a name="M000142"></a>
|
|
398
|
+
|
|
399
|
+
<div class="method-heading">
|
|
400
|
+
|
|
401
|
+
<a href="#M000142" class="method-signature">
|
|
402
|
+
|
|
403
|
+
<span class="method-name">worst_solution</span><span class="method-args">()</span>
|
|
404
|
+
|
|
405
|
+
</a>
|
|
406
|
+
|
|
407
|
+
</div>
|
|
408
|
+
|
|
409
|
+
<div class="method-description">
|
|
410
|
+
|
|
411
|
+
<p><a class="source-toggle" href="#"
|
|
412
|
+
onclick="toggleCode('M000142-source');return false;">[Source]</a></p>
|
|
413
|
+
<div class="method-source-code" id="M000142-source">
|
|
414
|
+
<pre>
|
|
415
|
+
<span class="ruby-comment cmt"># File lib/evosynth/evolvers/coevolutionary/balanced_coevolutionary.rb, line 76</span>
|
|
416
|
+
76: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">worst_solution</span>
|
|
417
|
+
77: <span class="ruby-ivar">@population</span>.<span class="ruby-identifier">worst</span>
|
|
418
|
+
78: <span class="ruby-keyword kw">end</span>
|
|
419
|
+
</pre>
|
|
420
|
+
</div>
|
|
421
|
+
|
|
422
|
+
</div>
|
|
423
|
+
</div>
|
|
424
|
+
|
|
425
|
+
|
|
426
|
+
|
|
427
|
+
</div>
|
|
428
|
+
|
|
429
|
+
|
|
430
|
+
|
|
431
|
+
|
|
432
|
+
</div>
|
|
433
|
+
|
|
434
|
+
<div id="validator-badges">
|
|
435
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
|
436
|
+
</div>
|
|
437
|
+
|
|
438
|
+
</body>
|
|
439
|
+
</html>
|