public void reproduceAvg(int cutoff){
        Random rand = new Random();
        int numOffsprings = C(cutoff,2);
        if(numOffsprings + cutoff > population.length){
            System.out.println("Invalid cutoff!");
            return;
        }
        Stack<Cell> temp = new Stack<Cell>();
        for(Cell c : population){
            temp.add(c);
        }
        Collections.sort(temp);
        ArrayList<Cell> survivors = new ArrayList<Cell>();
        ArrayList<Cell> newGen = new ArrayList<Cell>();
        for(int i=0; i<cutoff; i++){
            Cell t = temp.pop();
            survivors.add(t);
            newGen.add(t);
        }
        temp = null;
        for(int i=0; i<survivors.size()-1; i++){
            for(int j=i+1; j<survivors.size(); j++){
                float multiplier = rand.nextFloat();
                float p1[] = survivors.get(i).behavior.dna;
                float p2[] = survivors.get(j).behavior.dna;
                float child[] = new float[p1.length];
                for(int k=0; k<child.length; k++){
                    child[k] = (multiplier * p1[k]) + ((1-multiplier) * p2[k]);
                }
                newGen.add(new Cell(new Behavior(child),newGen.size()));
            }
        }
        for(int i=newGen.size(); i<population.length; i++){
            newGen.add(new Cell(new Behavior()));
        }
        newGen.toArray(population);
        generation++;
    }