lib/individual.rb
# Center Inverse Mutation (CIM)
# Separate gene in two parts, then reverse each of parts.
# [1,2,3,4,5,6] -> [1,2,3,4 | 5,6] -> [4,3,2,1 | 6,5]

Center Inverse Mutation (CIM)
Separate gene in two parts, then reverse each of parts.
Center Inverse Mutation ( CIM ) Separate gene in two parts then reverse each of parts .
def center_inverse_mutation(gene_ary)
    tmp_ary = gene_ary.dup
    pos = rand(gene_ary.size - 1) + 1  
    ary1 = tmp_ary.slice!(0, pos)
    return ary1.reverse + tmp_ary.reverse
  end
def center_inverse_mutation ( gene_ary ) tmp_ary = gene_ary . dup pos = rand ( gene_ary . size - 1 ) + 1 ary1 = tmp_ary . slice! ( 0 , pos ) return ary1 . reverse + tmp_ary . reverse end
Center Inverse Mutation (CIM)
Separate gene in two parts, then reverse each of parts.
Center Inverse Mutation ( CIM ) Separate gene in two parts then reverse each of parts .
# position for separation

gene_ary
<not_specific>