def _pdf_value(pdf, population, fitnesses, fitness_threshold):
    """Give the value of a pdf.

    This represents the likelihood of a pdf generating solutions
    that exceed the threshold.
    """
    # Add the chance of obtaining a solution from the pdf
    # when the fitness for that solution exceeds a threshold
    value = 0.0
    for solution, fitness in zip(population, fitnesses):
        if fitness >= fitness_threshold:
            # 1.0 + chance to avoid issues with chance of 0
            value += math.log(1.0 + _chance(solution, pdf))

    # The official equation states that value is now divided by len(fitnesses)
    # however, this is unnecessary when we are only obtaining the best pdf,
    # because every solution is of the same size
    return value
def _pdf_value ( pdf , population , fitnesses , fitness_threshold ) : value = 0.0 for solution , fitness in zip ( population , fitnesses ) : if fitness >= fitness_threshold : value += math . log ( 1.0 + _chance ( solution , pdf ) ) return value
Give the value of a pdf.

    This represents the likelihood of a pdf generating solutions
    that exceed the threshold.