Program: 39145
Project: 39145
Buggy source:
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) public static <T extends BoardGameState>ArrayList<Pair<double[],double[]>> playGame(BoardGame<T> bg,BoardGamePlayer<T>[] players,List<BoardGameFitnessFunction<T>> fitScores,List<BoardGameFitnessFunction<T>> otherFit){
  if (CommonConstants.watch && bg instanceof TwoDimensionalBoardGame) {
    view=MMNEAT.boardGameViewer;
  }
  double[][][] fitnesses=new double[bg.getNumPlayers()][bg.getNumPlayers()][fitScores.size()];
  double[][][] otherScores=new double[bg.getNumPlayers()][bg.getNumPlayers()][otherFit.size()];
  for (int i=0; i < bg.getNumPlayers(); i++) {
    if (CommonConstants.watch) {
      for (int j=0; j < bg.getNumPlayers(); j++) {
        System.out.println("String_Node_Str" + (j + 1) + "String_Node_Str"+ players[j]);
      }
    }
    bg.reset();
    for (    BoardGameFitnessFunction fitFunct : fitScores) {
      fitFunct.reset();
    }
    for (    BoardGameFitnessFunction fitFunct : otherFit) {
      fitFunct.reset();
    }
    while (!bg.isGameOver()) {
      if (CommonConstants.watch && bg instanceof TwoDimensionalBoardGame) {
        view.reset((TwoDimensionalBoardGameState)bg.getCurrentState());
      }
      if (stepByStep) {
      }
      int playIndex=bg.getCurrentPlayer();
      bg.move(players[playIndex]);
      for (      BoardGameFitnessFunction fitFunct : fitScores) {
        fitFunct.reset();
      }
      for (      BoardGameFitnessFunction fitFunct : otherFit) {
        fitFunct.updateFitness(bg.getCurrentState(),playIndex);
      }
    }
    if (CommonConstants.watch) {
      System.out.println("String_Node_Str" + bg.getWinners());
      if (bg instanceof TwoDimensionalBoardGame) {
        for (int j=0; j < bg.getNumPlayers(); j++) {
          System.out.println("String_Node_Str" + (j + 1) + "String_Node_Str"+ ((TwoDimensionalBoardGame)bg).pieceCount(j));
        }
      }
    }
    if (CommonConstants.watch && bg instanceof TwoDimensionalBoardGame) {
      view.reset((TwoDimensionalBoardGameState)bg.getCurrentState());
      if (stepByStep) {
        System.out.println("String_Node_Str");
        System.out.print("String_Node_Str");
        MiscUtil.waitForReadStringAndEnterKeyPress();
      }
    }
    boolean originalWatch=CommonConstants.watch;
    CommonConstants.watch=false;
    boolean originalStepByStep=stepByStep;
    stepByStep=false;
    for (int k=0; k < players.length; k++) {
      int playerIndex=(k + i) % bg.getNumPlayers();
      for (int j=0; j < fitScores.size(); j++) {
        fitnesses[k][i][j]=(1.0 * fitScores.get(j).getFitness(players[k],playerIndex));
      }
      if (otherFit.size() > 1) {
        for (int j=0; j < otherFit.size(); j++) {
          otherScores[k][i][j]=(1.0 * otherFit.get(j).getFitness(players[k],playerIndex));
        }
      }
    }
    if (MMNEAT.evalReport != null) {
      MMNEAT.evalReport.log("String_Node_Str" + (i + 1) + "String_Node_Str");
      for (int j=0; j < bg.getNumPlayers(); j++) {
        MMNEAT.evalReport.log("String_Node_Str" + (j + 1) + "String_Node_Str"+ players[j]);
        for (int k=0; k < fitScores.size(); k++) {
          MMNEAT.evalReport.log("String_Node_Str" + fitScores.get(k).getFitnessName() + "String_Node_Str"+ fitnesses[j][i][k]);
        }
        for (int k=0; k < otherFit.size(); k++) {
          MMNEAT.evalReport.log("String_Node_Str" + otherFit.get(k).getFitnessName() + "String_Node_Str"+ otherScores[j][i][k]);
        }
        MMNEAT.evalReport.log("String_Node_Str");
      }
      MMNEAT.evalReport.log("String_Node_Str" + bg.getWinners());
      if (bg instanceof TwoDimensionalBoardGame) {
        for (int j=0; j < bg.getNumPlayers(); j++) {
          MMNEAT.evalReport.log("String_Node_Str" + (j + 1) + "String_Node_Str"+ ((TwoDimensionalBoardGame)bg).pieceCount(j));
        }
      }
      MMNEAT.evalReport.log("String_Node_Str");
    }
    CommonConstants.watch=originalWatch;
    stepByStep=originalStepByStep;
    ArrayUtil.rotateRight(players,1);
  }
  if (MMNEAT.evalReport != null) {
    MMNEAT.evalReport.log("String_Node_Str");
  }
  ArrayList<Pair<double[],double[]>> scoring=new ArrayList<Pair<double[],double[]>>(bg.getNumPlayers());
  for (int k=0; k < players.length; k++) {
    Pair<double[],double[]> evalResults=NoisyLonerTask.averageResults(fitnesses[k],otherScores[k]);
    scoring.add(evalResults);
  }
  return scoring;
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) public static <T extends BoardGameState>ArrayList<Pair<double[],double[]>> playGame(BoardGame<T> bg,BoardGamePlayer<T>[] players,List<BoardGameFitnessFunction<T>> fitScores,List<BoardGameFitnessFunction<T>> otherFit){
  if (CommonConstants.watch && bg instanceof TwoDimensionalBoardGame) {
    view=MMNEAT.boardGameViewer;
  }
  double[][][] fitnesses=new double[bg.getNumPlayers()][bg.getNumPlayers()][fitScores.size()];
  double[][][] otherScores=new double[bg.getNumPlayers()][bg.getNumPlayers()][otherFit.size()];
  for (int i=0; i < bg.getNumPlayers(); i++) {
    if (CommonConstants.watch) {
      for (int j=0; j < bg.getNumPlayers(); j++) {
        System.out.println("String_Node_Str" + (j + 1) + "String_Node_Str"+ players[j]);
      }
    }
    bg.reset();
    for (    BoardGameFitnessFunction fitFunct : fitScores) {
      fitFunct.reset();
    }
    for (    BoardGameFitnessFunction fitFunct : otherFit) {
      fitFunct.reset();
    }
    while (!bg.isGameOver()) {
      if (CommonConstants.watch && bg instanceof TwoDimensionalBoardGame) {
        view.reset((TwoDimensionalBoardGameState)bg.getCurrentState());
      }
      if (stepByStep) {
      }
      int playIndex=bg.getCurrentPlayer();
      bg.move(players[playIndex]);
      for (      BoardGameFitnessFunction fitFunct : fitScores) {
        fitFunct.updateFitness(bg.getCurrentState(),playIndex);
      }
      for (      BoardGameFitnessFunction fitFunct : otherFit) {
        fitFunct.updateFitness(bg.getCurrentState(),playIndex);
      }
    }
    if (CommonConstants.watch) {
      System.out.println("String_Node_Str" + bg.getWinners());
      if (bg instanceof TwoDimensionalBoardGame) {
        for (int j=0; j < bg.getNumPlayers(); j++) {
          System.out.println("String_Node_Str" + (j + 1) + "String_Node_Str"+ ((TwoDimensionalBoardGame)bg).pieceCount(j));
        }
      }
    }
    if (CommonConstants.watch && bg instanceof TwoDimensionalBoardGame) {
      view.reset((TwoDimensionalBoardGameState)bg.getCurrentState());
      if (stepByStep) {
        System.out.println("String_Node_Str");
        System.out.print("String_Node_Str");
        MiscUtil.waitForReadStringAndEnterKeyPress();
      }
    }
    boolean originalWatch=CommonConstants.watch;
    CommonConstants.watch=false;
    boolean originalStepByStep=stepByStep;
    stepByStep=false;
    for (int k=0; k < players.length; k++) {
      int playerIndex=(k + i) % bg.getNumPlayers();
      for (int j=0; j < fitScores.size(); j++) {
        fitnesses[k][i][j]=(1.0 * fitScores.get(j).getFitness(players[k],playerIndex));
      }
      for (int j=0; j < otherFit.size(); j++) {
        otherScores[k][i][j]=(1.0 * otherFit.get(j).getFitness(players[k],playerIndex));
      }
    }
    if (MMNEAT.evalReport != null) {
      MMNEAT.evalReport.log("String_Node_Str" + (i + 1) + "String_Node_Str");
      for (int j=0; j < bg.getNumPlayers(); j++) {
        MMNEAT.evalReport.log("String_Node_Str" + (j + 1) + "String_Node_Str"+ players[j]);
        for (int k=0; k < fitScores.size(); k++) {
          MMNEAT.evalReport.log("String_Node_Str" + fitScores.get(k).getFitnessName() + "String_Node_Str"+ fitnesses[j][i][k]);
        }
        for (int k=0; k < otherFit.size(); k++) {
          MMNEAT.evalReport.log("String_Node_Str" + otherFit.get(k).getFitnessName() + "String_Node_Str"+ otherScores[j][i][k]);
        }
        MMNEAT.evalReport.log("String_Node_Str");
      }
      MMNEAT.evalReport.log("String_Node_Str" + bg.getWinners());
      if (bg instanceof TwoDimensionalBoardGame) {
        for (int j=0; j < bg.getNumPlayers(); j++) {
          MMNEAT.evalReport.log("String_Node_Str" + (j + 1) + "String_Node_Str"+ ((TwoDimensionalBoardGame)bg).pieceCount(j));
        }
      }
      MMNEAT.evalReport.log("String_Node_Str");
    }
    CommonConstants.watch=originalWatch;
    stepByStep=originalStepByStep;
    ArrayUtil.rotateRight(players,1);
  }
  if (MMNEAT.evalReport != null) {
    MMNEAT.evalReport.log("String_Node_Str");
  }
  ArrayList<Pair<double[],double[]>> scoring=new ArrayList<Pair<double[],double[]>>(bg.getNumPlayers());
  for (int k=0; k < players.length; k++) {
    Pair<double[],double[]> evalResults=NoisyLonerTask.averageResults(fitnesses[k],otherScores[k]);
    scoring.add(evalResults);
  }
  return scoring;
}