Module: Evolvable::Gene::ClassMethods
- Defined in:
- lib/evolvable/gene.rb
Instance Method Summary collapse
- #combine(gene_a, gene_b) ⇒ Object (also: #crossover)
- #key ⇒ Object
- #key=(val) ⇒ Object
Instance Method Details
#combine(gene_a, gene_b) ⇒ Object Also known as: crossover
47 48 49 |
# File 'lib/evolvable/gene.rb', line 47 def combine(gene_a, gene_b) [gene_a, gene_b].sample end |
#key ⇒ Object
43 44 45 |
# File 'lib/evolvable/gene.rb', line 43 def key @key end |
#key=(val) ⇒ Object
39 40 41 |
# File 'lib/evolvable/gene.rb', line 39 def key=(val) @key = val end |