Previous Page | Next Page

The GA Procedure

EvaluateLC Call

evaluates linear constraints


The inputs to the EvaluateLC subroutine are as follows:

lc

is a two-dimensional array representing the linear constraints.

results

is a numeric array to receive the magnitude of the constraint violation for each linear constraint.

sum

is a variable to receive the sum of the constraint violations over all the constraints.

selected    

is an array identifying the selected solution.

seg

is the segment of the solution to which the linear constraints apply.

child

is an optional parameter, and should be specified only when EvaluateLC is called from a user crossover operator.

The EvaluateLC routine can be called from a user crossover operator, mutation operator, or objective function to determine if a solution violates linear inequality constraints of the form . For linear constraints in variables, the lc array should have dimension . For each linear constraint , lc for , and lc. The results array should be one-dimensional with size . The EvaluateLC call fills in the elements of results such that

     

In the variable sum, the EvaluateLC call returns the value results. Note that sum , and sum implies that no constraints are violated. When you call EvaluateLC from your user routine, the selected parameter of the EvaluateLC call must be the same as the first parameter passed to your user routine to properly identify the solution to be checked. The seg parameter identifies which segment of the solution should be checked. Real, integer, or Boolean encodings can be checked with this routine. If EvaluateLC is called from a user crossover operator, the child parameter must be specified to indicate which offspring is to be checked. The value child = 1 requests the first offspring, child = 2 requests the second, and so on.

Previous Page | Next Page | Top of Page