def check_feasibility (bsol, problem, simulation=(False, 50)):
    """
    This method checks the feasibility of a solution.

    :param bsol: The solution expressed with a binary matrix 
    :param problem: The instance of problem

    :param simulation: NOT USED RIGHT NOW (to use in case of stochastic demand)    

    """
    # Check the feasibilities 
    feasible = (bsol * problem.avail).sum() == problem.n_postcodes
    if not feasible:
        return False

    # Check the capacity constraints 
    delivery_qties = (bsol * problem.demand).sum(axis=0)
    feasible = all(delivery_qties >= problem.mincap) and all(delivery_qties <= problem.maxcap)
    if not feasible:
        return False
    
    # Eventual feasibility
    return True