private static Robot.Direction SelectAction(ExplorationPolicy ep, Map<StateActionPair, Double> QTable,
        Map<Point, Integer> ExplorationTable, GridWorld gridWorld, Robot robot)
    {
        Random random = new Random();
        //Get all available actions
        ArrayList<Robot.Direction> walkableDirections = robot.GetWalkableDirections();

        //Select action using selected Exploration Policy
        Robot.Direction currentAction = null;
        switch (ep)
        {
            case GreedyWithExplorationBonus:
                //Find maximum number of times a State has been visited
                int maxVisitCount = Collections.max(ExplorationTable.values()) + 1;
                double maxQTableValue = Collections.max(QTable.values()) + 1;

                double maxValue = -1;
                for (Robot.Direction direction : walkableDirections)
                {
                    StateActionPair stateActionPair = new StateActionPair(robot.GetLocation(), direction);
                    double qValue = QTable.get(stateActionPair)/maxQTableValue;
                    double explorationValue = 1 - (double)ExplorationTable.get(Robot.GetNewLocation(gridWorld, robot.GetLocation(), direction))/(double)maxVisitCount;
                    double score = qValue + explorationValue;

                    //System.out.println(stateActionPair + " Exploration: " + explorationValue + " QValue: " + qValue);

                    if (score > maxValue)
                    {
                        currentAction = direction;
                        maxValue = score;
                    }
                }
                break;
            case Random:
                currentAction = walkableDirections.get(random.nextInt(walkableDirections.size()));
                break;
            case Greedy:
                double maxValue2 = -1;
                for (Robot.Direction direction : walkableDirections)
                {
                    StateActionPair stateActionPair = new StateActionPair(robot.GetLocation(), direction);
                    double score = QTable.get(stateActionPair);

                    if (score > maxValue2)
                    {
                        currentAction = direction;
                        maxValue2 = score;
                    }
                }
                break;
            default:
                System.out.println("Exploration Policy not implemented.");
                System.exit(0);
        }

        return currentAction;
    }