Inside this function all the problem specific variables are defined. The kind of implementation determines, how good the genetic algorithm can work on and solve the problem. However, this is only applicable for small problems. These functions implement a broad class of problems. For an overview of the mathematical description see Examples of objective functions .
Every row corresponds to one individual.
Because of being called with many individuals the objective function calculates the same mathematical expressions more than ones. This could be done in a for-loop. However, here is a highly recommended place for vectorization . Beside calculating the objective values the objective function could be used for defining default values for lower and upper bound and a default dimension of the problem. Additionally, the example functions provide a descriptive string for labeling plots and, if known, the minimal objective value.