def get_fitness(solution):

    """Return the fitness value of the passed solution"""

    if not solution:

        return 0

    # the fitness of a valid solution coincides with its value
    return solution.value