private double getConstraint ( double x1 , double x2 ) { double c1 , c2 , h ; c1 = - x1 * x1 - x2 * x2 + 1 + 0.1 * Math . cos ( 16 * Math . atan ( x1 / x2 ) ) ; c2 = ( x1 - 0.5 ) * ( x1 - 0.5 ) + ( x2 - 0.5 ) * ( x2 - 0.5 ) - 0.5 ; if ( c1 > c2 ) h = ( c1 > 0 ) ? c1 : 0 ; else h = ( c2 > 0 ) ? c2 : 0 ; return h ; }
use the design parameters to compute the constraint equation to get the value