def compute_scale_fitness_value(upper_prediction, lower_prediction, real_value):
    rate_real_value_in_prediction_interval = 0
    num_sample = len(upper_prediction)
    for i in range(num_sample):
        _real_value = real_value[i][0]
        lower_border = lower_prediction[i]
        higher_border = upper_prediction[i]
        if ((_real_value <= higher_border) and (_real_value >= lower_border)):
            rate_real_value_in_prediction_interval += (1 / num_sample)
    return rate_real_value_in_prediction_interval
def compute_scale_fitness_value(upper_prediction, lower_prediction, real_value):
    rate_real_value_in_prediction_interval = 0
    num_sample = len(upper_prediction)
    for i in range(num_sample):
        _real_value = real_value[i][0]
        lower_border = lower_prediction[i]
        higher_border = upper_prediction[i]
        if ((_real_value <= higher_border) and (_real_value >= lower_border)):
            rate_real_value_in_prediction_interval += (1 / num_sample)
    return rate_real_value_in_prediction_interval