Program: 39325
Project: 39325
Buggy source:
public Action getAction(Observation o){
  TetrisState tempState=new TetrisState();
  tempState.currentX=o.intArray[TetrisState.TETRIS_STATE_CURRENT_X_INDEX];
  tempState.currentY=o.intArray[TetrisState.TETRIS_STATE_CURRENT_Y_INDEX];
  tempState.currentRotation=o.intArray[TetrisState.TETRIS_STATE_CURRENT_ROTATION_INDEX];
  for (int p=0; p < TetrisState.TETRIS_STATE_NUMBER_POSSIBLE_BLOCKS; p++) {
    if (o.intArray[tempState.worldState.length + p] == 1) {
      tempState.currentBlockId=p;
    }
  }
  for (int i=0; i < tempState.worldState.length; i++) {
    tempState.worldState[i]=o.intArray[i];
  }
  boolean currentWatch=CommonConstants.watch;
  CommonConstants.watch=false;
  HashSet<Pair<TetrisState,ArrayList<Integer>>> tetrisStateHolder=TertisAfterStateGenerator.evaluateAfterStates(tempState);
  CommonConstants.watch=currentWatch;
  ArrayList<Pair<Double,Integer>> outputPairs=new ArrayList<Pair<Double,Integer>>();
  double[] outputs;
  for (  Pair<TetrisState,ArrayList<Integer>> i : tetrisStateHolder) {
    double[] inputs=MMNEAT.rlGlueExtractor.extract(i.t1.get_observation());
    double[] inputsScaled=scaleInputs(inputs);
    outputs=this.consultPolicy(inputsScaled);
    Pair<Double,Integer> tempPair=new Pair<Double,Integer>(outputs[0],i.t2.get(0));
    outputPairs.add(tempPair);
  }
  double[] outputForArgmax=new double[outputPairs.size()];
  for (int i=0; i < outputForArgmax.length; i++) {
    outputForArgmax[i]=outputPairs.get(1).t1;
  }
  int index=StatisticsUtilities.argmax(outputForArgmax);
  Action action=new Action(TSO.getNumDiscreteActionDims(),TSO.getNumContinuousActionDims());
  action.intArray[0]=outputPairs.get(index).t2;
  return action;
}

Fixed version (ground truth):
public Action getAction(Observation o){
  TetrisState tempState=new TetrisState();
  tempState.currentX=o.intArray[TetrisState.TETRIS_STATE_CURRENT_X_INDEX];
  tempState.currentY=o.intArray[TetrisState.TETRIS_STATE_CURRENT_Y_INDEX];
  tempState.currentRotation=o.intArray[TetrisState.TETRIS_STATE_CURRENT_ROTATION_INDEX];
  for (int p=0; p < TetrisState.TETRIS_STATE_NUMBER_POSSIBLE_BLOCKS; p++) {
    if (o.intArray[tempState.worldState.length + p] == 1) {
      tempState.currentBlockId=p;
    }
  }
  for (int i=0; i < tempState.worldState.length; i++) {
    tempState.worldState[i]=o.intArray[i];
  }
  boolean currentWatch=CommonConstants.watch;
  CommonConstants.watch=false;
  HashSet<Pair<TetrisState,ArrayList<Integer>>> tetrisStateHolder=TertisAfterStateGenerator.evaluateAfterStates(tempState);
  CommonConstants.watch=currentWatch;
  ArrayList<Pair<Double,Integer>> outputPairs=new ArrayList<Pair<Double,Integer>>();
  double[] outputs;
  for (  Pair<TetrisState,ArrayList<Integer>> i : tetrisStateHolder) {
    double[] inputs=MMNEAT.rlGlueExtractor.extract(i.t1.get_observation());
    double[] inputsScaled=scaleInputs(inputs);
    outputs=this.consultPolicy(inputsScaled);
    Pair<Double,Integer> tempPair=new Pair<Double,Integer>(outputs[0],i.t2.get(0));
    outputPairs.add(tempPair);
  }
  double[] outputForArgmax=new double[outputPairs.size()];
  for (int i=0; i < outputForArgmax.length; i++) {
    outputForArgmax[i]=outputPairs.get(i).t1;
  }
  int index=StatisticsUtilities.argmax(outputForArgmax);
  Action action=new Action(TSO.getNumDiscreteActionDims(),TSO.getNumContinuousActionDims());
  action.intArray[0]=outputPairs.get(index).t2;
  return action;
}