Program: 39191
Project: 39191
Buggy source:
/** 
 * all actions performed in a single evaluation of a genotype loop taken from GameVisualSimulationTest, the rest based on MsPacManTask.oneEval()
 * @param individual genotype to be evaluated
 * @param num which evaluation is currently being performed
 * @return Combination of fitness scores (multiobjective possible), andother scores (for tracking non-fitness data)
 */
@Override public Pair<double[],double[]> oneEval(Genotype<T> individual,int num){
  utt=new UnitTypeTable();
  averageUnitDifference=0;
  baseUpTime=0;
  harvestingEfficiencyIndex=0;
  pgs=initialPgs.clone();
  ef.givePhysicalGameState(pgs);
  gs=new GameState(pgs,utt);
  if (!AiInitialized)   initializeAI();
 else {
    ef.givePhysicalGameState(initialPgs);
    if (ef2 != null)     ef2.givePhysicalGameState(initialPgs);
  }
  if (Parameters.parameters.classParameter("String_Node_Str") != null) {
    enemySet=enemies.getAppropriateEnemy(MMNEAT.ea.currentGeneration());
  }
 else {
    enemySet.add(ai2);
  }
  ef.setNetwork(individual);
  if (CommonConstants.watch)   w=PhysicalGameStatePanel.newVisualizer(gs,MicroRTSUtility.WINDOW_LENGTH,MicroRTSUtility.WINDOW_LENGTH,false,PhysicalGameStatePanel.COLORSCHEME_BLACK);
  System.out.println(enemySet.toString());
  double[][] fitnesses=new double[enemySet.size()][numObjectives()];
  double[][] others=new double[enemySet.size()][numOtherScores()];
  for (int i=0; i < enemySet.size(); i++) {
    ai2=enemySet.get(i);
    if (CommonConstants.watch) {
      System.out.println("String_Node_Str" + ai2.getClass().getName());
    }
    ArrayList<Pair<double[],double[]>> currentEval=MicroRTSUtility.oneEval((AI)ai1,ai2,this,ff,w);
    fitnesses[i]=currentEval.get(0).t1;
    others[i]=currentEval.get(0).t1;
  }
  Pair<double[],double[]> averageResults=NoisyLonerTask.averageResults(fitnesses,others);
  return averageResults;
}

Fixed version (ground truth):
/** 
 * all actions performed in a single evaluation of a genotype loop taken from GameVisualSimulationTest, the rest based on MsPacManTask.oneEval()
 * @param individual genotype to be evaluated
 * @param num which evaluation is currently being performed
 * @return Combination of fitness scores (multiobjective possible), andother scores (for tracking non-fitness data)
 */
@Override public Pair<double[],double[]> oneEval(Genotype<T> individual,int num){
  utt=new UnitTypeTable();
  averageUnitDifference=0;
  baseUpTime=0;
  harvestingEfficiencyIndex=0;
  pgs=initialPgs.clone();
  ef.givePhysicalGameState(pgs);
  gs=new GameState(pgs,utt);
  if (!AiInitialized)   initializeAI();
 else {
    ef.givePhysicalGameState(initialPgs);
    if (ef2 != null)     ef2.givePhysicalGameState(initialPgs);
  }
  if (Parameters.parameters.classParameter("String_Node_Str") != null) {
    enemySet=enemies.getAppropriateEnemy(MMNEAT.ea.currentGeneration());
  }
 else {
    enemySet.add(ai2);
  }
  ef.setNetwork(individual);
  if (CommonConstants.watch)   w=PhysicalGameStatePanel.newVisualizer(gs,MicroRTSUtility.WINDOW_LENGTH,MicroRTSUtility.WINDOW_LENGTH,false,PhysicalGameStatePanel.COLORSCHEME_BLACK);
  System.out.println(enemySet.toString());
  double[][] fitnesses=new double[enemySet.size()][numObjectives()];
  double[][] others=new double[enemySet.size()][numOtherScores()];
  for (int i=0; i < enemySet.size(); i++) {
    ai2=enemySet.get(i);
    if (CommonConstants.watch) {
      System.out.println("String_Node_Str" + ai2.getClass().getName());
    }
    ArrayList<Pair<double[],double[]>> currentEval=MicroRTSUtility.oneEval((AI)ai1,ai2,this,ff,w);
    fitnesses[i]=currentEval.get(0).t1;
    others[i]=currentEval.get(0).t2;
  }
  Pair<double[],double[]> averageResults;
  if (growingEnemySet && enemySet.size() > 1) {
  }
  averageResults=new Pair<double[],double[]>(fitnesses[0],others[0]);
  return averageResults;
}