Tabnine Logo
DAGNode.getOutgoingEdges
Code IndexAdd Tabnine to your IDE (free)

How to use
getOutgoingEdges
method
in
org.grouplens.grapht.graph.DAGNode

Best Java code snippets using org.grouplens.grapht.graph.DAGNode.getOutgoingEdges (Showing top 20 results out of 315)

origin: lenskit/lenskit

for (DAGEdge<Component,Dependency> edge: node.getOutgoingEdges()) {
  if (!edgeIsTransient(edge)) {
    boolean es = shared.contains(edge.getTail());
origin: lenskit/lenskit

  @Override
  public void describe(DAGNode<Component, Dependency> node, DescriptionWriter description) {
    node.getLabel().getSatisfaction().visit(new LabelDescriptionVisitor(description));
    description.putField("cachePolicy", node.getLabel().getCachePolicy().name());
    List<DAGNode<Component, Dependency>> edges =
        node.getOutgoingEdges()
        .stream()
        .sorted(GraphtUtils.DEP_EDGE_ORDER)
        .map(DAGEdge::getTail)
        .collect(Collectors.toList());
    description.putList("dependencies", edges, INSTANCE);
  }
}
origin: lenskit/lenskit

String rid = dumper.setRoot(graph);
for (DAGEdge<Component, Dependency> e: graph.getOutgoingEdges()) {
  DAGNode<Component, Dependency> target = e.getTail();
  Component csat = target.getLabel();
origin: lenskit/lenskit

for (DAGEdge<Component, Dependency> edge: node.getOutgoingEdges()) {
  if (!GraphtUtils.edgeIsTransient(edge)) {
    bld.addEdge(edge.getTail(), edge.getLabel());
origin: lenskit/lenskit

  .setShared(!unsharedNodes.contains(currentNode))
  .setIsProvider(pid != null);
List<DAGEdge<Component, Dependency>> edges = Lists.newArrayList(currentNode.getOutgoingEdges());
Collections.sort(edges, GraphtUtils.DEP_EDGE_ORDER);
for (DAGEdge<Component, Dependency> e: edges) {
origin: lenskit/lenskit

  public DAGNode<Component, Dependency> processNode(@Nonnull DAGNode<Component, Dependency> node, @Nonnull DAGNode<Component, Dependency> original) {
    Component label = node.getLabel();
    if (!label.getSatisfaction().hasInstance()) {
      Satisfaction instanceSat = Satisfactions.nullOfType(label.getSatisfaction().getErasedType());
      Component newLbl = Component.create(instanceSat,
                        label.getCachePolicy());
      // build new node with replacement label
      DAGNodeBuilder<Component,Dependency> bld = DAGNode.newBuilder(newLbl);
      // retain all non-transient edges
      for (DAGEdge<Component,Dependency> edge: node.getOutgoingEdges()) {
        if (!GraphtUtils.edgeIsTransient(edge)) {
          bld.addEdge(edge.getTail(), edge.getLabel());
        }
      }
      DAGNode<Component,Dependency> repl = bld.build();
      logger.debug("simulating instantiation of {}", node);
      return repl;
    } else {
      return node;
    }
  }
}
origin: lenskit/lenskit

  public DAGNode<Component, Dependency> processNode(@Nonnull DAGNode<Component, Dependency> node, @Nonnull DAGNode<Component, Dependency> original) {
    Component label = node.getLabel();
    Satisfaction satisfaction = label.getSatisfaction();
    if (satisfaction.hasInstance()) {
      return node;
    }
    Object obj = instantiator.apply(node);

    Satisfaction instanceSat;
    if (obj == null) {
      instanceSat = Satisfactions.nullOfType(satisfaction.getErasedType());
    } else {
      instanceSat = Satisfactions.instance(obj);
    }
    Component newLabel = Component.create(instanceSat, label.getCachePolicy());
    // build new node with replacement label
    DAGNodeBuilder<Component,Dependency> bld = DAGNode.newBuilder(newLabel);
    // retain all non-transient edges
    for (DAGEdge<Component, Dependency> edge: node.getOutgoingEdges()) {
      if (!GraphtUtils.edgeIsTransient(edge)) {
        bld.addEdge(edge.getTail(), edge.getLabel());
      }
    }
    return bld.build();
  }
}
origin: org.grouplens.grapht/grapht

while (!work.isEmpty()) {
  DAGNode<V, E> node = work.remove();
  for (DAGEdge<V, E> e : node.getOutgoingEdges()) {
origin: org.grouplens.grapht/grapht

private Map<Desire, Instantiator> makeDependencyMap(DAGNode<Component, Dependency> node, SetMultimap<DAGNode<Component, Dependency>, DAGEdge<Component, Dependency>> backEdges) {
  Set<DAGEdge<Component,Dependency>> edges = node.getOutgoingEdges();
  if (backEdges.containsKey(node)) {
    ImmutableSet.Builder<DAGEdge<Component,Dependency>> bld = ImmutableSet.builder();
    edges = bld.addAll(edges)
          .addAll(backEdges.get(node))
          .build();
  }
  ImmutableSet.Builder<Desire> desires = ImmutableSet.builder();
  for (DAGEdge<Component,Dependency> edge: edges) {
    desires.add(edge.getLabel().getInitialDesire());
  }
  return Maps.asMap(desires.build(), new DepLookup(edges, backEdges));
}
origin: org.grouplens.grapht/grapht

/**
 * Do a breadth-first search for an edge.
 *
 * @param pred The predicate for matching nodes.
 * @return The first node matching {@code pred} in a breadth-first search, or {@code null} if no
 *         such node is found.
 */
public DAGEdge<V, E> findEdgeBFS(@Nonnull Predicate<? super DAGEdge<V, E>> pred) {
  Queue<DAGNode<V, E>> work = Lists.newLinkedList();
  Set<DAGNode<V, E>> seen = Sets.newHashSet();
  work.add(this);
  seen.add(this);
  while (!work.isEmpty()) {
    DAGNode<V, E> node = work.remove();
    for (DAGEdge<V, E> e : node.getOutgoingEdges()) {
      // is this the edge we are looking for?
      if (pred.apply(e)) {
        return e;
      } else if (!seen.contains(e.getTail())) {
        seen.add(e.getTail());
        work.add(e.getTail());
      }
    }
  }
  // no node found
  return null;
}
origin: org.lenskit/lenskit-core

for (DAGEdge<Component,Dependency> edge: node.getOutgoingEdges()) {
  if (!edgeIsTransient(edge)) {
    boolean es = shared.contains(edge.getTail());
origin: org.grouplens.grapht/grapht

/**
 * Create a new builder initialized to build a copy of the specified node.
 * @param node The node to copy.
 * @param <V> The type of node labels.
 * @param <E> The type of edge labels.
 * @return A new builder initialized with the labels and edges of {@code node}.
 */
public static <V,E> DAGNodeBuilder<V,E> copyBuilder(DAGNode<V,E> node) {
  DAGNodeBuilder<V,E> bld = newBuilder(node.getLabel());
  for (DAGEdge<V,E> edge: node.getOutgoingEdges()) {
    bld.addEdge(edge.getTail(), edge.getLabel());
  }
  return bld;
}
origin: org.grouplens.lenskit/lenskit-eval

  @Override
  public void describe(DAGNode<Component, Dependency> node, DescriptionWriter description) {
    node.getLabel().getSatisfaction().visit(new LabelDescriptionVisitor(description));
    description.putField("cachePolicy", node.getLabel().getCachePolicy().name());
    List<DAGNode<Component, Dependency>> edges =
        Lists.transform(GraphtUtils.DEP_EDGE_ORDER.sortedCopy(node.getOutgoingEdges()),
                DAGEdge.<Component,Dependency>extractTail());
    description.putList("dependencies", edges, INSTANCE);
  }
}
origin: org.grouplens.grapht/grapht

DAGNode<Component, Dependency> parent = current.node;
assert parent.getOutgoingEdges().isEmpty();
origin: org.grouplens.lenskit/lenskit-eval

String rid = dumper.setRoot(graph);
for (DAGEdge<Component, Dependency> e: graph.getOutgoingEdges()) {
  DAGNode<Component, Dependency> target = e.getTail();
  Component csat = target.getLabel();
origin: org.lenskit/lenskit-core

  public DAGNode<Component, Dependency> processNode(@Nonnull DAGNode<Component, Dependency> node, @Nonnull DAGNode<Component, Dependency> original) {
    Component label = node.getLabel();
    if (!label.getSatisfaction().hasInstance()) {
      Satisfaction instanceSat = Satisfactions.nullOfType(label.getSatisfaction().getErasedType());
      Component newLbl = Component.create(instanceSat,
                        label.getCachePolicy());
      // build new node with replacement label
      DAGNodeBuilder<Component,Dependency> bld = DAGNode.newBuilder(newLbl);
      // retain all non-transient edges
      for (DAGEdge<Component,Dependency> edge: node.getOutgoingEdges()) {
        if (!GraphtUtils.edgeIsTransient(edge)) {
          bld.addEdge(edge.getTail(), edge.getLabel());
        }
      }
      DAGNode<Component,Dependency> repl = bld.build();
      logger.debug("simulating instantiation of {}", node);
      return repl;
    } else {
      return node;
    }
  }
}
origin: org.grouplens.lenskit/lenskit-eval

  .setShared(!unsharedNodes.contains(currentNode))
  .setIsProvider(pid != null);
List<DAGEdge<Component, Dependency>> edges = Lists.newArrayList(currentNode.getOutgoingEdges());
Collections.sort(edges, GraphtUtils.DEP_EDGE_ORDER);
for (DAGEdge<Component, Dependency> e: edges) {
origin: org.lenskit/lenskit-core

  public DAGNode<Component, Dependency> processNode(@Nonnull DAGNode<Component, Dependency> node, @Nonnull DAGNode<Component, Dependency> original) {
    Component label = node.getLabel();
    Satisfaction satisfaction = label.getSatisfaction();
    if (satisfaction.hasInstance()) {
      return node;
    }
    Object obj = instantiator.apply(node);

    Satisfaction instanceSat;
    if (obj == null) {
      instanceSat = Satisfactions.nullOfType(satisfaction.getErasedType());
    } else {
      instanceSat = Satisfactions.instance(obj);
    }
    Component newLabel = Component.create(instanceSat, label.getCachePolicy());
    // build new node with replacement label
    DAGNodeBuilder<Component,Dependency> bld = DAGNode.newBuilder(newLabel);
    // retain all non-transient edges
    for (DAGEdge<Component, Dependency> edge: node.getOutgoingEdges()) {
      if (!GraphtUtils.edgeIsTransient(edge)) {
        bld.addEdge(edge.getTail(), edge.getLabel());
      }
    }
    return bld.build();
  }
}
origin: org.grouplens.grapht/grapht

                 Map<DAGEdge<Component, Dependency>, DAGEdge<Component, Dependency>> replacements) throws ResolutionException {
assert context.getTailValue().getLeft().equals(root.getLabel().getSatisfaction());
for (DAGEdge<Component, Dependency> edge: root.getOutgoingEdges()) {
  logger.debug("considering {} for replacement", edge.getTail().getLabel());
  Desire desire = edge.getLabel().getDesireChain().getInitialDesire();
origin: org.grouplens.lenskit/lenskit-eval

for (DAGEdge<Component, Dependency> edge: node.getOutgoingEdges()) {
  if (!GraphtUtils.edgeIsTransient(edge)) {
    bld.addEdge(edge.getTail(), edge.getLabel());
org.grouplens.grapht.graphDAGNodegetOutgoingEdges

Javadoc

Get the outgoing edges of this node.

Popular methods of DAGNode

  • getLabel
    Get the label for this node.
  • getReachableNodes
  • newBuilder
    Construct a new DAG node builder.
  • getOutgoingEdgeWithLabel
  • getSortedNodes
    Topographical sort all nodes reachable from the given root node. Nodes that are farther away, or mor
  • replaceNode
    Replace one node with another in this graph. All edges referencing node are replaced with edges refe
  • breadthFirstEdges
  • <init>
    Construct a new DAG node.
  • copyBuilder
    Create a new builder initialized to build a copy of the specified node.
  • getAdjacentNodes
    Get the nodes that are adjacent to this node (only considering outgoing edges).
  • getIncomingEdgeMap
    Get a multimap of incoming edges. For each node reachable from this node, the map will contain each
  • initializeCaches
    Initialize caches for traversing this node.
  • getIncomingEdgeMap,
  • initializeCaches,
  • singleton,
  • sortVisit,
  • transformEdges

Popular in Java

  • Updating database using SQL prepared statement
  • setRequestProperty (URLConnection)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • addToBackStack (FragmentTransaction)
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • SocketTimeoutException (java.net)
    This exception is thrown when a timeout expired on a socket read or accept operation.
  • Dictionary (java.util)
    Note: Do not use this class since it is obsolete. Please use the Map interface for new implementatio
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • JCheckBox (javax.swing)
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now