public static void setGoalGradMerged(State pState) {

		// set high values
		for (int row = 0; row < nbRows; row++) {
			// for each col
			for (int col = 0; col < nbCols; col++) {
				goalGradMerged[row][col] = -1;
			}
		}

		int value;
		// for each row
		for (int row = 0; row < nbRows; row++) {
			// for each col
			for (int col = 0; col < nbCols; col++) {
				// for every goal
				value = Integer.MAX_VALUE;
				for (int i = 0; i < nbBoxes; i++) {
					if (pState.isGoalOccupied(i)) continue;
					// Choose the min value
					if (value > goalGrad[i][row][col] && goalGrad[i][row][col] != -1) {
						goalGradMerged[row][col] = goalGrad[i][row][col];
						value = goalGrad[i][row][col];
					}
				}
			}
		}

		/* Print the board
        for (int row = 0; row < nbRows; row++) {
            // for each col
            System.out.println();
            for (int col = 0; col < nbCols; col++) {
                System.out.print(goalGradMerged[row][col]);

            }
        }
		 */
	}