class SimpleGrayCodeBinaryRepresentation extends SimpleBinaryRepresentation {

    @Override
    protected void encodeBinaryGenome() {
        boolean[] grayGenome = new boolean[this.genome.length];
        int index = 0; // index in all genome
        for (int variable = 0; variable < this.descriptor.numVariables; variable++){
            grayGenome[index] = this.genome[index++]; // MSB bit of every variable is preserved
            for (int i = 1; i < this.descriptor.variablesLengths[variable]; i++){
                grayGenome[index] = this.genome[index-1] ^ this.genome[index++];
            }
        }
        this.genome = grayGenome;
    }

    public  SimpleGrayCodeBinaryRepresentation(SimpleBinaryGenomeDescriptor descriptor);
    public  SimpleGrayCodeBinaryRepresentation(SimpleGrayCodeBinaryRepresentation second);

}