def f20(x, rotation=None, shift=None, shuffle=None): """ Hybrid Function 10 (N=6) Args: x (array): Input vector of dimension 2, 10, 20, 30, 50 or 100. rotation (matrix): Optional rotation matrix. If None (default), the official matrix from the benchmark suite will be used. shift (array): Optional shift vector. If None (default), the official vector from the benchmark suite will be used. shuffle (array): Optionbal shuffle vector. If None (default), the official permutation vector from the benchmark suite will be used. """ nx = len(x) if rotation is None: rotation = transforms.rotations[nx][19] if shift is None: shift = transforms.shifts[19][:nx] if shuffle is None: shuffle = transforms.shuffles[nx][9] x_transformed = np.matmul(rotation, x - shift) x_parts = _shuffle_and_partition(x_transformed, shuffle, [0.1, 0.1, 0.2, 0.2, 0.2, 0.2]) y = basic.happy_cat(x_parts[0]) y += basic.katsuura(x_parts[1]) y += basic.ackley(x_parts[2]) y += basic.rastrigin(x_parts[3]) y += basic.modified_schwefel(x_parts[4]) y += basic.schaffers_f7(x_parts[5]) return y + 2000.0
def f17(x, rotation=None, shift=None, shuffle=None): """ Hybrid Function 7 (N=5) Args: x (array): Input vector of dimension 2, 10, 20, 30, 50 or 100. rotation (matrix): Optional rotation matrix. If None (default), the official matrix from the benchmark suite will be used. shift (array): Optional shift vector. If None (default), the official vector from the benchmark suite will be used. shuffle (array): Optionbal shuffle vector. If None (default), the official permutation vector from the benchmark suite will be used. """ nx = len(x) if rotation is None: rotation = transforms.rotations[nx][16] if shift is None: shift = transforms.shifts[16][:nx] if shuffle is None: shuffle = transforms.shuffles[nx][6] x_transformed = np.matmul(rotation, x - shift) x_parts = _shuffle_and_partition(x_transformed, shuffle, [0.1, 0.2, 0.2, 0.2, 0.3]) y = basic.katsuura(x_parts[0]) y += basic.ackley(x_parts[1]) y += basic.expanded_griewanks_plus_rosenbrock(x_parts[2]) y += basic.modified_schwefel(x_parts[3]) y += basic.rastrigin(x_parts[4]) return y + 1700.0
def f12(x, rotation=None, shift=None, shuffle=None): """ Hybrid Function 2 (N=3) Args: x (array): Input vector of dimension 2, 10, 20, 30, 50 or 100. rotation (matrix): Optional rotation matrix. If None (default), the official matrix from the benchmark suite will be used. shift (array): Optional shift vector. If None (default), the official vector from the benchmark suite will be used. shuffle (array): Optionbal shuffle vector. If None (default), the official permutation vector from the benchmark suite will be used. """ nx = len(x) if rotation is None: rotation = transforms.rotations[nx][11] if shift is None: shift = transforms.shifts[11][:nx] if shuffle is None: shuffle = transforms.shuffles[nx][1] x_transformed = np.matmul(rotation, x - shift) x_parts = _shuffle_and_partition(x_transformed, shuffle, [0.3, 0.3, 0.4]) y = basic.high_conditioned_elliptic(x_parts[0]) y += basic.modified_schwefel(x_parts[1]) y += basic.bent_cigar(x_parts[2]) return y + 1200.0
def f16(x, rotation=None, shift=None, shuffle=None): """ Hybrid Function 6 (N=4) Args: x (array): Input vector of dimension 2, 10, 20, 30, 50 or 100. rotation (matrix): Optional rotation matrix. If None (default), the official matrix from the benchmark suite will be used. shift (array): Optional shift vector. If None (default), the official vector from the benchmark suite will be used. shuffle (array): Optionbal shuffle vector. If None (default), the official permutation vector from the benchmark suite will be used. """ nx = len(x) if rotation is None: rotation = transforms.rotations[nx][15] if shift is None: shift = transforms.shifts[15][:nx] if shuffle is None: shuffle = transforms.shuffles[nx][5] x_transformed = np.matmul(rotation, x - shift) x_parts = _shuffle_and_partition(x_transformed, shuffle, [0.2, 0.2, 0.3, 0.3]) y = basic.expanded_schaffers_f6(x_parts[0]) y += basic.h_g_bat(x_parts[1]) y += basic.rosenbrock(x_parts[2]) y += basic.modified_schwefel(x_parts[3]) return y + 1600.0
def f10(x, rotation=None, shift=None): """ Shifted and Rotated Schwefel’s Function Args: x (array): Input vector of dimension 2, 10, 20, 30, 50 or 100. rotation (matrix): Optional rotation matrix. If None (default), the official matrix from the benchmark suite will be used. shift (array): Optional shift vector. If None (default), the official vector from the benchmark suite will be used. """ nx = len(x) if rotation is None: rotation = transforms.rotations[nx][9] if shift is None: shift = transforms.shifts[9][:nx] x_transformed = np.matmul(rotation, (x - shift)) return basic.modified_schwefel(x_transformed) + 1000.0