private void variableMutation(){
    	
        //Check if any max fitness the last few generations has differed greatly. If not increase mutation, if yes then reduce
        HashMap temp = (HashMap) stats.get(stats.size()-1);
        double lastFitness = (Double) temp.get("maxFitness");
        boolean thresholdBreached = false;
        for (int i = 2; i < 6; i++){

            double someFitness = (Double) temp.get("maxFitness");
            if (Math.max(lastFitness, someFitness) - 
                    Math.min(lastFitness, someFitness) > 0.05) thresholdBreached = true;
        }
        if(thresholdBreached){

           if(rep.getMutationRate() - 0.01 > baseMutationRate){
                rep.setMutationRate(baseMutationRate);
                System.out.println("Mutation rate reduced to "+ rep.getMutationRate() +"!");
            }
        }else{
            if(rep.getMutationRate() + 0.01 < 1.0){
                rep.setMutationRate(rep.getMutationRate() + 0.01);
                System.out.println("Mutation rate increased to "+ rep.getMutationRate() +"!");
            }
        }
    }