<commit_before>export default class {
  constructor(
    mutationFunction = (phenotype) => phenotype,
    crossoverFunction = (a, b) => [a, b],
    fitnessFunction = (phenotype) => 0 ,
    isABetterThanBFunction = undefined,
    population = [],
    populationSize = 100){

      this.mutationFunction = mutationFunction;
      this.crossoverFunction = crossoverFunction;
      this.fitnessFunction = fitnessFunction;
      this.isABetterThanBFunction = isABetterThanBFunction;
      this.population = population;
      this.populationSize = 100;
      this.chanceOfMutation = 50;
  }

  populate () {
      var size = this.population.length;
      while( this.population.length < this.populationSize ) {
          this.population.push(
              this.mutate(
                  this.population[ Math.floor( Math.random() * size ) ]
              )
          );
      }
  }

  mutate(phenotype) {
    return this.mutationFunction(phenotype);
  }
<commit_msg>population size and chance of mutation argument fix<commit_after>export default class {
  constructor(
    mutationFunction = (phenotype) => phenotype,
    crossoverFunction = (a, b) => [a, b],
    fitnessFunction = (phenotype) => 0 ,
    isABetterThanBFunction = undefined,
    population = [],
    populationSize = 100,
    chanceOfMutation = 50){

      this.mutationFunction = mutationFunction;
      this.crossoverFunction = crossoverFunction;
      this.fitnessFunction = fitnessFunction;
      this.isABetterThanBFunction = isABetterThanBFunction;
      this.population = population;
      this.populationSize = populationSize;
      this.chanceOfMutation = chanceOfMutation;
  }

  populate () {
      var size = this.population.length;
      while( this.population.length < this.populationSize ) {
          this.population.push(
              this.mutate(
                  this.population[ Math.floor( Math.random() * size ) ]
              )
          );
      }
  }

  mutate(phenotype) {
    return this.mutationFunction(phenotype);
  }

{'fraction_non_alphanumeric': 0.10039761431411531, 'fraction_numerical': 0.007455268389662028, 'mean_word_length': 2.588235294117647, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7267250', 'n_tokens_mistral': 626, 'n_tokens_neox': 561, 'n_words': 109}