class GenotypeNPointCrossoverReproductionOperator extends AbstractNPointCrossoverReproductionOperator {

    @Override
    protected void reproduceInternal(Individual[] firstChildren, Individual[] secondChildren) {
        // make crossover
        for (int i = 0; i < firstChildren.length; i++){
            GenotypeRepresentation firstRepresentation = ((GenotypeRepresentation)firstChildren[i].getRepresentation());
            GenotypeRepresentation secondRepresentation = ((GenotypeRepresentation)secondChildren[i].getRepresentation());

            double parentFitness = Math.max(firstChildren[i].getFitness(), secondChildren[i].getFitness());
            firstChildren[i].setParentFitness(parentFitness);
            secondChildren[i].setParentFitness(parentFitness);
            
            boolean[] cutPointFlags = this.makeCutPointFlags(this.crossPointCount, firstRepresentation.getTotalLength());
            for (int j = 0; j < cutPointFlags.length; j++){
                if (!cutPointFlags[j]){
                    firstRepresentation.swapGenes(secondRepresentation, j, j+1);
                }
            }
        }
    }

}