What controls to using the real encoding in genetic algorithm
– the variables which using in the problem
– or the initial population
Or there are other reasons.
Thanks in advance.
Best Answer
I'm sorry, but I do not understand your question. The default data type inga is real doubles. You can use a custom data type, but then you have to handle all population generation, mutation, crossover, scoring, and constraints yourself. Seethis example using a custom data type. Or you can usemixed-integer optimization using a specific construct, theIntCon argument.
Use normal default MATLAB variables, not any other type.
The mixed-integer solver, as its name suggests, is MIXED-integer, meaning some variables can be continuous. To keep it simple, one data type is used for all variables.
bitstring variables have many limitations,documented here, such as no constraints are allowed.
Variables are standard MATLAB variables. The solution is a vector.
For mixed-integer optimization, variables are standard doubles. If you want a binary variable, give integer type. a lower bound of 0, and an upper bound of 1. Seethe documentation, which I tried to make clear.
Best Answer