function mutationFunction(phenotype) {
phenotype = cloneJSON(phenotype)
var chance = Math.random()
var index = Math.floor( Math.random() * phenotype.numbers.length )
if ( chance < 0.1 && phenotype.numbers.length > 0 ) {
phenotype.numbers.splice( index , 1 )
return phenotype
} else if ( chance < 0.2 ) {
var numbers = phenotype.numbers.slice( 0 , index )
.concat( phenotype.numbers.slice( index , index+1 ) )
.concat( phenotype.numbers.slice( index ) )
phenotype.numbers = numbers
return phenotype
} else {
phenotype.numbers[index] += Math.random() * 20 - 10;
return phenotype;
}
}