MATLAB: How does ga handle mixed integer constraint violations

Global Optimization Toolbox

I was reading this doc page:
and came across the section that talks about how the integer 'ga' algorithm determines penalty. I have 2 questions:
1. What does the algorithm do if all members are infeasible, since 'the penalty function is the maximum fitness function among feasible members of the population, plus a sum of the constraint violations of the (infeasible) point.'?
2. When selecting the initial points, does the function make any effort to ensure the starting population contains feasible members?

Best Answer

1. In this case, the algorithm will set the maximum fitness function value to 0, so the total penalty function is just the sum of the constraint violations of the infeasible point.
This is a choice that is suggested by Kalyanmoy Deb, the author of a paper from which most of the details of the penalty function are derived. The paper is located at the bottom of the link above.
2. When working with integer constraints, 'ga' always uses 'gacreationuniform' function when creating the initial population. More details on this can be found at the below link:
Once it has created the initial population, it does not do any further checks to ensure that it has generated feasible points beyond making any integer constraints values integers.