This can have false positives.
    For examples, parameters can only be 0 or 5, and the summation constraint is between 6 and 7.

def check_feasibility(x_bounds, lowerbound, upperbound):
    '''
    This can have false positives.
    For examples, parameters can only be 0 or 5, and the summation constraint is between 6 and 7.
    '''
    # x_bounds should be sorted, so even for "discrete_int" type,
    # the smallest and the largest number should the first and the last element
    x_bounds_lowerbound = sum([x_bound[0] for x_bound in x_bounds])
    x_bounds_upperbound = sum([x_bound[-1] for x_bound in x_bounds])

    # return ((x_bounds_lowerbound <= lowerbound) and (x_bounds_upperbound >= lowerbound)) or \
    #        ((x_bounds_lowerbound <= upperbound) and (x_bounds_upperbound >= upperbound))
    return (x_bounds_lowerbound <= lowerbound <= x_bounds_upperbound) or \
           (x_bounds_lowerbound <= upperbound <= x_bounds_upperbound)