def goal_fitness_reached(generation_best_fitness, goal_fitness, minimize):
    """ This function returns True if the goal fitness is reached.

    :param generation_best_fitness: (int) Current generation best fitness.
    :param goal_fitness: (int) Goal fitness.
    :param minimize: (bool) If 1, the goal is minimize the fitness function and viceversa.
    :return:
        (bool) True if the goal fitness is reached.
    """
    if minimize:
        return generation_best_fitness <= goal_fitness
    else:
        return generation_best_fitness >= goal_fitness