def fitness_f(x):
    """calculates the total value and weight, if the weight is over 15, 
    the individual receives a penalization with 0 fitness"""
    weight = 0
    value = 0
    for i in range(len(x.genes)):
        weight += x.genes[i][0]
        value += x.genes[i][1]
    if weight <= 15:
        return value
    return 0