def cxBlend(ind1, ind2, alpha):
 for (i, (x1, x2)) in enumerate(zip(ind1, ind2)):
  gamma = (((1.0 + (2.0 * alpha)) * random.random()) - alpha)
  ind1[i] = (((1.0 - gamma) * x1) + (gamma * x2))
  ind2[i] = ((gamma * x1) + ((1.0 - gamma) * x2))
 return (ind1, ind2)

def cxBlend ( ind1 , ind2 , alpha ) : for ( i , ( x1 , x2 ) ) in enumerate ( zip ( ind1 , ind2 ) ) : gamma = ( ( ( 1.0 + ( 2.0 * alpha ) ) * random . random ( ) ) - alpha ) ind1 [ i ] = ( ( ( 1.0 - gamma ) * x1 ) + ( gamma * x2 ) ) ind2 [ i ] = ( ( gamma * x1 ) + ( ( 1.0 - gamma ) * x2 ) ) return ( ind1 , ind2 )
executes a blend crossover that modify in-place the input individuals .