class BitSetBinaryRepresentation implements GenotypeRepresentation {

    protected void integerToBinary(double[] intValues){
        int maxIndex = -1;
        int minIndex;
        double currentValue;
        double newValue;
        // for every variable...
        for (int variableIdx = 0; variableIdx < intValues.length; variableIdx++){
            currentValue = intValues[variableIdx];
            minIndex = maxIndex; // previous maxIndex is current minIndex
            maxIndex += this.descriptor.getVariablesLengths()[variableIdx]; // move maxIndex forward
            // ... divide its value and place it to appropriate place
            for (int genomeIdx = maxIndex; genomeIdx > minIndex; genomeIdx--){
                newValue = Math.floor(currentValue / 2.0);
                this.genome.set(genomeIdx, ( (currentValue - newValue * 2.0) > 0.5) );
                currentValue = newValue;
            }
        }
        encodeBinaryGenome();
    }

    public  BitSetBinaryRepresentation(SimpleBinaryGenomeDescriptor descriptor);
    public  BitSetBinaryRepresentation(BitSetBinaryRepresentation second);

}