Altering vector of doubles to satisfy boundary constraints
Altering vector of doubles to satisfy boundary constraints
Byte based crossover and mutation operators can generate variables out of bounds of the decision variables. This function controls if variables are between their lower and upper bounds and if not, draws random numbers between these ranges. This function directly modifies the argument doubles and does not return a value.
EnsureBounds(doubles, mins, maxs)
Arguments
doubles: A vector of doubles
mins: A vector of lower bounds of decision variables
maxs: A vector of upper bounds of decision variables
Returns
Function directly modifies the argument doubles and does not return a result.