def planInvalidInMap(map, state):
    """
    Just checks to be sure the first two cells are occupiable.  In low
    noise conditions, it's good to check the whole plan, so failures
    are discovered earlier;  but in high noise, we often have to get
    close to a location before we decide that it is really not safe to
    traverse. 
    """
    end = min(2, len(state))
    for s in state[:end]:
        if not map.robotCanOccupy(s):
            return True
    return False
