@Override
    public void mutate() {
        Population offspring = new Population();
        for (int i = 0; i < population.getSize(); i += 2){
            HiffIndividual ancestorOne = getAncestor();
            HiffIndividual ancestorTwo = getAncestor();
            for (int k = 0; k < ancestorOne.getSize(); ++k){
                double r;
                synchronized (rng){
                    r = rng.nextDouble();
                }
                if (r < INVERSE_PROBABILITY){
                    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;
        }
    }