def penalty_function(nearness, buff=10 ** -6):
    """
    weak regime --> far from constraint violation
    strong regime --> close to but not doing constraint violation
    negative regime --> already in violation of constraints

    Penalty function must be continuous!
    """
    if nearness > 0:
        return 0
    else:
        return 10 ** 64 * (1 - nearness)
