def cxESBlend(ind1, ind2, alpha):
 for (i, (x1, s1, x2, s2)) in enumerate(zip(ind1, ind1.strategy, ind2, ind2.strategy)):
  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))
  gamma = (((1.0 + (2.0 * alpha)) * random.random()) - alpha)
  ind1.strategy[i] = (((1.0 - gamma) * s1) + (gamma * s2))
  ind2.strategy[i] = ((gamma * s1) + ((1.0 - gamma) * s2))
 return (ind1, ind2)

def cxESBlend ( ind1 , ind2 , alpha ) : for ( i , ( x1 , s1 , x2 , s2 ) ) in enumerate ( zip ( ind1 , ind1 . strategy , ind2 , ind2 . strategy ) ) : 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 ) ) gamma = ( ( ( 1.0 + ( 2.0 * alpha ) ) * random . random ( ) ) - alpha ) ind1 . strategy [ i ] = ( ( ( 1.0 - gamma ) * s1 ) + ( gamma * s2 ) ) ind2 . strategy [ i ] = ( ( gamma * s1 ) + ( ( 1.0 - gamma ) * s2 ) ) return ( ind1 , ind2 )
executes a blend crossover on both .