MATLAB: How to use binary bits in genetic algorithm for integer constraints

genetic algorithm

I have five different integer constraints. But when I select bit string option in matlab ga toolbox, I get the below error:
Optimization running. Error running optimization. Problem has integer constraints. PopulationType must be set to 'doubleVector'.
Also, I am not allowed to use single point/two point crossover. By default matlab is using scattered crossover when there are integer constraints. If it is possible to use binary bits for integer constraints in matlab ga toolbox, where may I set the size of the binary bits? Please help.

Best Answer

When you use bitstring all variables are single bit binary that for performance reasons are stored as double.
You can use the other crossover with bitstring.
https://www.mathworks.com/help/gads/genetic-algorithm-options.html#f14223