public void calculateNewValues()
    {
        double val[] = new double[mdpData.getNoOfStates()];
        
        if(prevValueList.size() != mdpData.getNoOfStates())
        {
            System.out.println("ValueIterationImpl : calculateNewValues :: prevVal array size != no of states");
        }
        double tempActionVal, maxStateVal;
        int stateCounter, maxActionIndex;
        ArrayList<Double> transitionList;
        for(int i=0; i<mdpData.getNoOfStates(); i++)
        {
            maxStateVal = 0.0;
            maxActionIndex = -1;
            tempActionVal = 0.0;
            for(int j=0; j<mdpData.getStateList().get(i).getNoOfActions(); j++)
            {
                tempActionVal =  mdpData.getStateList().get(i).getActionList().get(j).getReward();
                transitionList = mdpData.getStateList().get(i).getActionList().get(j).getTransitionFunc();
                for(stateCounter=0; stateCounter<mdpData.getNoOfStates(); stateCounter++)
                {
                    tempActionVal = tempActionVal + mdpData.getGamma() * (transitionList.get(stateCounter) * mdpData.getStateList().get(stateCounter).getValue());                    
                }
                if(tempActionVal > maxStateVal)
                {
                    maxStateVal = tempActionVal;
                    maxActionIndex = j;
                }
            }
            val[i] = maxStateVal;
            for(int k=0; k<mdpData.getStateList().get(i).getNoOfActions(); k++)
            {
                if(k==maxActionIndex)
                {
                    mdpData.getStateList().get(i).getActionList().get(k).setProbDist(1.0);
                }
                else
                {
                    mdpData.getStateList().get(i).getActionList().get(k).setProbDist(0.0);
                }
            }
        }
        mdpData.setValue(val);
    }