Class: EvoSynth::Recombinations::PartiallyMappedCrossover
- Inherits:
-
Object
- Object
- EvoSynth::Recombinations::PartiallyMappedCrossover
- Defined in:
- lib/evosynth/operators/recombinations/partially_mapped_crossover.rb
Overview
ABBILDUNGSREKOMBINATION (Weicker Page 133)
this recombination can only combine permutations, at least it only works on genomes without duplicate genes!
Instance Method Summary collapse
Instance Method Details
#recombine(parent_one, parent_two) ⇒ Object
38 39 40 41 42 43 44 45 |
# File 'lib/evosynth/operators/recombinations/partially_mapped_crossover.rb', line 38 def recombine(parent_one, parent_two) shorter = EvoSynth::Recombinations.individual_with_shorter_genome(parent_one, parent_two) indexes = rand_indexes(shorter) child_one = recombine_to_one(parent_one, parent_two, indexes, shorter) child_two = recombine_to_one(parent_two, parent_one, indexes, shorter) [child_one, child_two] end |
#to_s ⇒ Object
47 48 49 |
# File 'lib/evosynth/operators/recombinations/partially_mapped_crossover.rb', line 47 def to_s "mapping recombination" end |