public void createChoosingList() {
        double[] choosingList = new double[popSize];

        double min=fitness[0];
        for(int i=1;i<popSize;i++) {
            if(fitness[i]<min) {
                min = fitness[i];
            }
        }
        if(min < 0) {
            choosingList[0] = 0;
        } else {
            choosingList[0] = min;
        }
        for (int i = 1; i < popSize; i++) {
            if(min < 0) {
                choosingList[i] = fitness[i] + choosingList[i-1] - min;
            } else {
                choosingList[i] = fitness[i] + choosingList[i-1];
            }

        }
        double max=choosingList[0];
        for(int i=1;i<popSize;i++) {
            if(choosingList[i] > max) {
                max = choosingList[i];
            }
        }
        double randFit =rand.nextDouble()*max;
        int parent1 = checkIndex(randFit, choosingList);
        int parent2 = parent1;
        while (parent2 == parent1) {
            randFit =rand.nextDouble()*max;
            parent2 = checkIndex(randFit, choosingList);
        }
        crossOver(parent1,parent2);



    }