@Override
    public void mutate() {
        Population offspring = new Population();
        for (int i = 0; i < population.getSize(); i += 2){
            HiffIndividual ancestorOne = getAncestor();
            HiffIndividual ancestorTwo = getAncestor();
            int a;
            int b;
            synchronized (rng){
                a = Math.abs(rng.nextInt(ancestorOne.getSize()));
                b = Math.abs(rng.nextInt(ancestorOne.getSize()));
            }
            if (a > b){
                int temp = a;
                a = b;
                b = temp;
            }
            for (int k = a; k <= b; ++k){
                int tempOne = ancestorOne.getBlock().get(k);
                int tempTwo = ancestorTwo.getBlock().get(k);
                ancestorOne.set(k, tempTwo);
                ancestorTwo.set(k, tempOne);
            }
            offspring.addIndividual(ancestorOne);
            offspring.addIndividual(ancestorTwo);
        }
        double bestOld = population.getFittest();
        double bestNew = offspring.getFittest();
        if (bestNew > bestOld){
            reward = 1;
            for (int i = 0; i < population.getSize(); ++i){
                population.setIndividual(i, offspring.getIndividual(i));
            }
        } else if (bestNew == bestOld){
//            reward = 0.5;
            reward = 0;
        } else {
            reward = 0;
        }
    }