public double repairSolutionVariableValue ( double value , double lowerBound , double upperBound ) { if ( lowerBound > upperBound ) { throw new JMetalException ( "The lower bound (" + lowerBound + ") is greater than the " + "upper bound (" + upperBound + ")" ) ; } double result = value ; if ( value < lowerBound ) { result = randomGenerator . getRandomValue ( lowerBound , upperBound ) ; } if ( value > upperBound ) { result = randomGenerator . getRandomValue ( lowerBound , upperBound ) ; } return result ; }
Checks if the value is between its bounds ; if not a random value between the limits is returned