MATLAB: Crossover and mutation functions in GA was not considered while using integer variable indices (integer constrain)

ga

ga error.JPG

Best Answer

They are considered.
The way that integer constraints are enforced is that ga() puts in its own CrossoverFcn and MutationFcn that forces the constraints to be honored. User crossover and mutation functions have the risk of generating new entries that do not satisfy the integer constraints.
If you are certain that your crossover and mutation functions enforce your integer constraints, then leave your intcons empty, and set an initial population matrix that gives initial entries that are consistent with your integer constraints, and then count on your crossover and mutation functions to force the entries to continue to be integer.