Language Reference |
creates and initializes a solution population for a genetic algorithm optimization
The GAINIT call creates the members and computes the objective values for an initial solution population for a genetic algorithm optimization. If the problem encoding is specified as sequence in the corresponding GASETUP function call, and no modname parameter is specified, then GAINIT creates an initial population of vectors of randomly ordered integer values ranging from 1 to the size parameter of the GASETUP function call. Otherwise, you control how the population is created and initialized with the bounds and modname parameters.
If real or integer fixed-length vector encoding is specified in the corresponding GASETUP function call, then the bounds parameter can be supplied as a 2 n matrix, where the dimension n equals the size parameter of the GASETUP function call: the first row gives the lower bounds of the corresponding vector elements and the second row gives the upper bounds. The solutions resulting from all IML-supplied crossover and mutation operators are checked to ensure they are within the upper and lower bounds, and any solution components violating the bounds are reset to the bound. However, if user-written modules are provided for these operators, the modules are expected to do the bounds checking internally. If no modname parameter is specified, the initial population is generated by random variation of the solution components between the lower and upper bounds.
For all problem encodings, if the modname parameter is specified, it is expected to be the name of a user-written subroutine module with one parameter. The module should generate and return an individual solution in that parameter. The GAINIT call invokes that module popsize times, once for each member of the initial solution population. The modname parameter is required if the encoding parameter of the corresponding GASETUP function call was 0 or if the bounds parameter is not specified for real or integer fixed-length vector encoding.
See the GASETUP function for an example.
Copyright © 2009 by SAS Institute Inc., Cary, NC, USA. All rights reserved.