The GA Procedure

EvaluateLC Call

evaluates linear constraints

call EvaluateLC( lc, results, sum, selected, seg<, child> );

The inputs to the EvaluateLC subroutine are as follows:

lcis a two-dimensional array representing the linear constraints.
resultsis a numeric array to receive the magnitude of the constraint violation for each linear constraint.
sumis a variable to receive the sum of the constraint violations over all the constraints.
selected        is an array identifying the selected solution.
segis the segment of the solution to which the linear constraints apply.
childis 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 ax \leq b. For  n linear constraints in  m variables, the lc array should have dimension  n x (m+1). For each linear constraint  i=1, ... ,n, lc [i,j] = a[i,j] for  j = 1, ... ,m, and lc [i,m+1] = b[i]. The results array should be one-dimensional with size  n. The EvaluateLC call fills in the elements of results such that

{results}[i] = \{ 0, & { if } \sum\limits_{j=1}^m a[i,j] x[j] \leq b[i] \    \sum\limits_{j=1}^ma[i,j] x[j] - b[i], & {otherwise}    .

In the variable sum, the EvaluateLC call returns the value \sum_{i=1}^n results [i]. Note that sum \geq , and sum=0 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