The GA Procedure

SetCompareRoutine Call

call SetCompareRoutine ( ’routine’ ) ;

The SetCompareRoutine call installs a user function to compare the fitness of solutions. The input to the SetCompareRoutine subroutine is as follows:


is the name of a function you have defined, which is called when necessary to compare the fitness of solutions. This parameter must be a string literal; a variable is not accepted.

The SetCompareRoutine call enables you to designate a function you have defined to be used in the selection process when comparing the fitness of two solutions. The selector options that involve ranking solutions by fitness, including tournament and duel selection, will use the designated function instead of comparing the objective values directly. If the SetCompareRoutine is not called, or if it is called with an input value of 'default', then the objective function value will be used to compare solution fitness. The SetCompareRoutine call provides you with a way to factor multiple fitness criteria into the selection process. See the section Defining a User Fitness Comparison Routine for a full description of how the fitness comparison routine should be structured and what it should return. You can use this feature to implement multiobjective optimization and other advanced optimization strategies.