public boolean isIndirectlyBlocked(final Individual blocked) { final Individual parent = blocked.getParent(); if (parent == null) return false; blocked.setBlocked(isBlocked(parent)); return blocked.isBlocked(); }
public boolean isIndirectlyBlocked(final Individual blocked) { final Individual parent = blocked.getParent(); if (parent == null) return false; blocked.setBlocked(isBlocked(parent)); return blocked.isBlocked(); }
protected boolean isDirectlyBlockedInt(final Individual blocked) { final Individual parentBlocked = blocked.getParent(); if (blocked.isRoot() || parentBlocked.isRoot()) return false; final BlockingContext cxt = new BlockingContext(blocked); while (cxt.moveBlockerUp()) if (isDirectlyBlockedBy(cxt)) { blocked.setBlocked(true); _logger.finer(() -> blocked + " blocked by " + cxt._blocker); return true; } if (OpenlletOptions.USE_ANYWHERE_BLOCKING) { assert cxt._blocker.isRoot(); return isDirectlyBlockedByDescendant(cxt); } return false; }
protected boolean isDirectlyBlockedInt(final Individual blocked) { final Individual parentBlocked = blocked.getParent(); if (blocked.isRoot() || parentBlocked.isRoot()) return false; final BlockingContext cxt = new BlockingContext(blocked); while (cxt.moveBlockerUp()) if (isDirectlyBlockedBy(cxt)) { blocked.setBlocked(true); _logger.finer(() -> blocked + " blocked by " + cxt._blocker); return true; } if (OpenlletOptions.USE_ANYWHERE_BLOCKING) { assert cxt._blocker.isRoot(); return isDirectlyBlockedByDescendant(cxt); } return false; }
protected boolean isDirectlyBlockedByDescendant(final BlockingContext cxt) { if (cxt._blocked.getParent().equals(cxt._blocker)) return false; if (!cxt._blocker.isRoot() && isDirectlyBlockedBy(cxt)) { cxt._blocked.setBlocked(true); _logger.finer(() -> cxt._blocked + " _blocked by " + cxt._blocker); return true; } final Individual blocker = cxt._blocker; for (final Edge e : blocker.getOutEdges()) { final Node child = e.getTo(); if (cxt.moveBlockerDown(child)) { if (isDirectlyBlockedByDescendant(cxt) || cxt._blocker.isRoot()) return true; cxt.moveBlockerUp(); } } return false; }
protected boolean isDirectlyBlockedByDescendant(final BlockingContext cxt) { if (cxt._blocked.getParent().equals(cxt._blocker)) return false; if (!cxt._blocker.isRoot() && isDirectlyBlockedBy(cxt)) { cxt._blocked.setBlocked(true); _logger.finer(() -> cxt._blocked + " _blocked by " + cxt._blocker); return true; } final Individual blocker = cxt._blocker; for (final Edge e : blocker.getOutEdges()) { final Node child = e.getTo(); if (cxt.moveBlockerDown(child)) { if (isDirectlyBlockedByDescendant(cxt) || cxt._blocker.isRoot()) return true; cxt.moveBlockerUp(); } } return false; }