Previous Page | Next Page

Language Reference

GAGETMEM Call

CALL GAGETMEM( members, values, id<, index> ) ;

The GAGETMEM subroutine gets members of the current solution population for a genetic algorithm optimization.

The GAGETMEM call returns the following values as output arguments:

members

names a matrix that contains the members of the current solution population specified by the index parameter.

values

names a matrix that contains objective function values, with a value at each row that corresponds to the solution in members.

The input arguments to the GAGETMEM call are as follows:

id

is the identifier for the genetic algorithm optimization problem, which was returned by the GASETUP function.

index

is a matrix of indices of the requested solution population members. If index is not specified, the entire population is returned.

The GAGETMEM call is used to retrieve members of the solution population and their objective function values. If the elite parameter of the GASETSEL call is nonzero, then the first elite members of the population have the most optimal objective function values of the population, and those elite members are sorted in ascending order of objective function value for a minimization problem and in descending order for a maximization problem.

If a single member is requested, that member is returned as-is in members. If more than one member is requested in a GAGETMEM call, each row of members has one solution, shaped into a row vector. If solutions are not of fixed length, then the number of columns of members equals the number of elements of the largest solution and rows that represent solutions with fewer elements have the extra elements filled in with missing values.

See the GASETUP function for an example.

Previous Page | Next Page | Top of Page