PGACreate(8)

PGACreate8

Creates an uninitialized context variable. the fortran version of this function call contains only the last three arguments

Usage

int *argc

char **argv

int datatype

int len

int maxormin

Input parameters

argc

- address of the count of the number of command line arguments.

argv

- array of command line arguments.

datatype

- the data type used for the strings. Must be one of PGA_DATATYPE_BINARY, PGA_DATATYPE_CHARACTER, PGA_DATATYPE_INTEGER, PGA_DATATYPE_REAL, or PGA_DATATYPE_USER

binary

-valued, character-valued, integer-valued,

real

-valued, or a user-defined datatype, respectively.

len

- the string length (number of genes).

maxormin

- the direction of optimization. Must be one of PGA_MAXIMIZE or PGA_MINIMIZE for maximization or minimization, respectively.

Output parameters

none

Location

create.c

Examples

Example:
In C:
void main(int argc, char **argv) {
PGAContext *ctx;
:
ctx = PGACreate(&argc, argv, PGA_DATATYPE_BINARY, 100, PGA_MAXIMIZE);
:
//  Set options here
:
PGASetUp(ctx);
:
//  Run the GA here
:
PGADestroy(ctx);
}
In FORTRAN:
integer ctx
:
ctx = PGACreate(PGA_DATATYPE_BINARY, 100, PGA_MAXIMIZE)
:
c       Set options here
:
call PGASetUp(ctx)
:
c       Run the GA here
:
call PGADestroy(ctx)
stop
end

Releases

Unchanged in 4 releases since Debian 5.0 (Lenny).

  1. 5.0–8

From pgapack 1.1.1-3 in Debian 8 (Jessie). Parsed by carta from the page's man source.