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 f18(x, rotation=None, shift=None, shuffle=None): """ Hybrid Function 8 (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][17] if shift is None: shift = transforms.shifts[17][:nx] if shuffle is None: shuffle = transforms.shuffles[nx][7] x_transformed = np.matmul(rotation, x - shift) x_parts = _shuffle_and_partition(x_transformed, shuffle, [0.2, 0.2, 0.2, 0.2, 0.2]) y = basic.high_conditioned_elliptic(x_parts[0]) y += basic.ackley(x_parts[1]) y += basic.rastrigin(x_parts[2]) y += basic.h_g_bat(x_parts[3]) y += basic.discus(x_parts[4]) return y + 1800.0
def f19(x, rotation=None, shift=None, shuffle=None): """ Hybrid Function 9 (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][18] if shift is None: shift = transforms.shifts[18][:nx] if shuffle is None: shuffle = transforms.shuffles[nx][8] x_transformed = np.matmul(rotation, x - shift) x_parts = _shuffle_and_partition(x_transformed, shuffle, [0.2, 0.2, 0.2, 0.2, 0.2]) y = basic.bent_cigar(x_parts[0]) y += basic.rastrigin(x_parts[1]) y += basic.expanded_griewanks_plus_rosenbrock(x_parts[2]) y += basic.weierstrass(x_parts[3]) y += basic.expanded_schaffers_f6(x_parts[4]) return y + 1900.0
def f15(x, rotation=None, shift=None, shuffle=None): """ Hybrid Function 5 (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][14] if shift is None: shift = transforms.shifts[14][:nx] if shuffle is None: shuffle = transforms.shuffles[nx][4] 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.bent_cigar(x_parts[0]) y += basic.h_g_bat(x_parts[1]) y += basic.rastrigin(x_parts[2]) y += basic.rosenbrock(x_parts[3]) return y + 1500.0
def f5(x, rotation=None, shift=None): """ Shifted and Rotated Rastrigin'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][4] if shift is None: shift = transforms.shifts[4][:nx] x_transformed = np.matmul(rotation, (x - shift)) return basic.rastrigin(x_transformed) + 500.0