Program: 39126
Project: 39126
Buggy source:
/** 
 * Given the current parent population, return the next parent population
 * @param parents = current parent population
 * @return = next parent population
 */
@Override public ArrayList<Genotype<T>> getNextGeneration(ArrayList<Genotype<T>> parents){
  evaluatingParents=true;
  long start=System.currentTimeMillis();
  System.out.println("String_Node_Str");
  ArrayList<Score<T>> parentScores=task.evaluateAll(parents);
  long end=System.currentTimeMillis();
  System.out.println("String_Node_Str" + TimeUnit.MILLISECONDS.toMinutes(end - start) + "String_Node_Str");
  if (TWEANN.preferenceNeuron()) {
    EvolutionaryHistory.maxModes=0;
    EvolutionaryHistory.minModes=Integer.MAX_VALUE;
    if (parentScores.get(0).individual instanceof TWEANNGenotype) {
      for (      Score<T> g : parentScores) {
        TWEANNGenotype tg=(TWEANNGenotype)g.individual;
        EvolutionaryHistory.maxModes=Math.max(tg.numModules,EvolutionaryHistory.maxModes);
        EvolutionaryHistory.minModes=Math.min(tg.numModules,EvolutionaryHistory.minModes);
      }
    }
  }
  evaluatingParents=false;
  start=System.currentTimeMillis();
  System.out.println("String_Node_Str");
  ArrayList<Score<T>> childrenScores=processChildren(parentScores);
  end=System.currentTimeMillis();
  System.out.println("String_Node_Str" + TimeUnit.MILLISECONDS.toMinutes(end - start) + "String_Node_Str");
  logParentInfo(parentScores);
  if (writeOutput) {
    ArrayList<Score<T>> combined=new ArrayList<Score<T>>(mu + lambda);
    combined.addAll(parentScores);
    combined.addAll(childrenScores);
    MMNEAT.logPerformanceInformation(combined,generation);
  }
  ArrayList<Genotype<T>> result=selectAndAdvance(parentScores,childrenScores);
  if (Parameters.parameters.booleanParameter("String_Node_Str") && currentGeneration() == Parameters.parameters.integerParameter("String_Node_Str")) {
    if (Parameters.parameters.booleanParameter("String_Node_Str")) {
      result=OffsetHybrIDGenotype.getSubstrateGenotypesFromCPPNs(HyperNEATUtil.getHyperNEATTask(),result);
    }
 else {
      CommonConstants.hyperNEAT=false;
      Parameters.parameters.setBoolean("String_Node_Str",false);
      CommonConstants.monitorInputs=Parameters.parameters.booleanParameter("String_Node_Str");
      HyperNEATUtil.clearHyperNEATVisualizations();
      TWEANNGenotype.smallerGenotypes=true;
      Parameters.parameters.setClass("String_Node_Str",TWEANNGenotype.class);
      CommonConstants.netChangeActivationRate=0;
      Parameters.parameters.setDouble("String_Node_Str",0);
      result=PopulationUtil.getSubstrateGenotypesFromCPPNs(HyperNEATUtil.getHyperNEATTask(),result,0);
      TWEANNGenotype exemplar=(TWEANNGenotype)result.get(0).copy();
      long maxInnovation=0;
      for (      LinkGene lg : exemplar.links) {
        maxInnovation=Math.max(maxInnovation,lg.innovation);
      }
      EvolutionaryHistory.setInnovation(maxInnovation + 1);
      EvolutionaryHistory.initArchetype(0,null,exemplar);
    }
  }
  return result;
}

Fixed version (ground truth):
/** 
 * Given the current parent population, return the next parent population
 * @param parents = current parent population
 * @return = next parent population
 */
@Override public ArrayList<Genotype<T>> getNextGeneration(ArrayList<Genotype<T>> parents){
  evaluatingParents=true;
  long start=System.currentTimeMillis();
  System.out.println("String_Node_Str");
  ArrayList<Score<T>> parentScores=task.evaluateAll(parents);
  long end=System.currentTimeMillis();
  System.out.println("String_Node_Str" + TimeUnit.MILLISECONDS.toMinutes(end - start) + "String_Node_Str");
  if (TWEANN.preferenceNeuron()) {
    EvolutionaryHistory.maxModes=0;
    EvolutionaryHistory.minModes=Integer.MAX_VALUE;
    if (parentScores.get(0).individual instanceof TWEANNGenotype) {
      for (      Score<T> g : parentScores) {
        TWEANNGenotype tg=(TWEANNGenotype)g.individual;
        EvolutionaryHistory.maxModes=Math.max(tg.numModules,EvolutionaryHistory.maxModes);
        EvolutionaryHistory.minModes=Math.min(tg.numModules,EvolutionaryHistory.minModes);
      }
    }
  }
  evaluatingParents=false;
  start=System.currentTimeMillis();
  System.out.println("String_Node_Str");
  ArrayList<Score<T>> childrenScores=processChildren(parentScores);
  end=System.currentTimeMillis();
  System.out.println("String_Node_Str" + TimeUnit.MILLISECONDS.toMinutes(end - start) + "String_Node_Str");
  logParentInfo(parentScores);
  if (writeOutput) {
    ArrayList<Score<T>> combined=new ArrayList<Score<T>>(mu + lambda);
    combined.addAll(parentScores);
    combined.addAll(childrenScores);
    MMNEAT.logPerformanceInformation(combined,generation);
  }
  ArrayList<Genotype<T>> result=selectAndAdvance(parentScores,childrenScores);
  if (CommonConstants.hybrID && currentGeneration() == Parameters.parameters.integerParameter("String_Node_Str")) {
    if (Parameters.parameters.booleanParameter("String_Node_Str")) {
      result=OffsetHybrIDGenotype.getSubstrateGenotypesFromCPPNs(HyperNEATUtil.getHyperNEATTask(),result);
    }
 else {
      CommonConstants.hyperNEAT=false;
      Parameters.parameters.setBoolean("String_Node_Str",false);
      CommonConstants.monitorInputs=Parameters.parameters.booleanParameter("String_Node_Str");
      HyperNEATUtil.clearHyperNEATVisualizations();
      TWEANNGenotype.smallerGenotypes=true;
      Parameters.parameters.setClass("String_Node_Str",TWEANNGenotype.class);
      CommonConstants.netChangeActivationRate=0;
      Parameters.parameters.setDouble("String_Node_Str",0);
      result=PopulationUtil.getSubstrateGenotypesFromCPPNs(HyperNEATUtil.getHyperNEATTask(),result,0);
      TWEANNGenotype exemplar=(TWEANNGenotype)result.get(0).copy();
      long maxInnovation=0;
      for (      LinkGene lg : exemplar.links) {
        maxInnovation=Math.max(maxInnovation,lg.innovation);
      }
      EvolutionaryHistory.setInnovation(maxInnovation + 1);
      EvolutionaryHistory.initArchetype(0,null,exemplar);
    }
  }
  return result;
}