function Mutator (probability, rate) {
  if ( probability >= 1 )
    return;
  this.probability = probability;
  this.rate = rate;
  this.arity = 1;
  this.apply = mutator_apply;
}

function mutator_apply( guy ) {
  var other_guy = guy.clone();
  var chromosome_here = "";
  for ( var i = 0; i < other_guy.chromosome.length; i ++ ) {
    if (Math.random() < this.probability ) {
      chromosome_here = chromosome_here.concat( (other_guy.chromosome.charAt(i) == "1")?"0":"1");
    } else {
      chromosome_here = chromosome_here.concat(  other_guy.chromosome.charAt(i));
    }
  }
  other_guy.chromosome = chromosome_here;
  other_guy.fitness = null;
  return other_guy
}

