import math


def obj_function(vector):
    """
    Hardcode the objective function and calculate its value.
    :param vector: a single vector of variables
    :return: the value of the obj. function for the given vector
    """
    #Rao's example
    #value = 500 - 20*vector[0] - 26*vector[1] - 4*vector[0]*vector[1] + 4*(vector[0])**2 + 3*(vector[1])**2
    value = (-20) * math.exp(-0.2 * math.sqrt(0.5 * ((vector[0] ** 2 + (vector[1] ** 2))))) - math.exp(0.5 * (math.cos(vector[0] * 2 * math.pi) + math.cos(vector[1] * 2 * math.pi))) + math.e + 20
    return value