edu.uci.ics.jung.graph.Graph.getSource()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(6.4k)|赞(0)|评价(0)|浏览(111)

本文整理了Java中edu.uci.ics.jung.graph.Graph.getSource()方法的一些代码示例,展示了Graph.getSource()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Graph.getSource()方法的具体详情如下:
包路径:edu.uci.ics.jung.graph.Graph
类名称:Graph
方法名:getSource

Graph.getSource介绍

[英]If directed_edge is a directed edge in this graph, returns the source; otherwise returns null. The source of a directed edge d is defined to be the vertex for which d is an outgoing edge. directed_edge is guaranteed to be a directed edge if its EdgeType is DIRECTED.
[中]如果directed_edge是此图中的有向边,则返回源;否则返回null。定向边d的源定义为d为输出边的顶点。如果其EdgeTypeDIRECTED,则directed_edge保证为定向边。

代码示例

代码示例来源:origin: geogebra/geogebra

/**
 * @see edu.uci.ics.jung.graph.Graph#getSource(java.lang.Object)
 */
@Override
public synchronized V getSource(E directed_edge) {
  return delegate.getSource(directed_edge);
}

代码示例来源:origin: net.sf.jung/jung-api

/**
 * @see edu.uci.ics.jung.graph.Graph#getSource(java.lang.Object)
 */
public V getSource(E directed_edge) {
  return delegate.getSource(directed_edge);
}

代码示例来源:origin: net.sf.jung/jung-api

/**
 * @see edu.uci.ics.jung.graph.Graph#getSource(java.lang.Object)
 */
public V getSource(E directed_edge) {
  return delegate.getSource(directed_edge);
}

代码示例来源:origin: geogebra/geogebra

/**
 * @see edu.uci.ics.jung.graph.Graph#getSource(java.lang.Object)
 */
@Override
public V getSource(E directed_edge) {
  return delegate.getSource(directed_edge);
}

代码示例来源:origin: geogebra/geogebra

/**
 * @see edu.uci.ics.jung.graph.Graph#getSource(java.lang.Object)
 */
@Override
public V getSource(E directed_edge) {
  return delegate.getSource(directed_edge);
}

代码示例来源:origin: net.sourceforge.jadex/jadex-tools-comanalyzer

/**
 * Returns the source of a directed edge.
 * @param directed_edge The edge.
 * @return The vertex.
 */
public Object getSource(Object directed_edge)
{
  return delegate.getSource(directed_edge);
}

代码示例来源:origin: net.sf.jung/jung-api

/**
 * @see edu.uci.ics.jung.graph.Graph#getSource(java.lang.Object)
 */
public synchronized V getSource(E directed_edge) {
  return delegate.getSource(directed_edge);
}

代码示例来源:origin: net.sf.jung/jung-visualization

public V getSource(E directedEdge) {
  return graph.getSource(directedEdge);
}
public int getSuccessorCount(V vertex) {

代码示例来源:origin: org.opendaylight.nic/of-renderer

private void discardCommonReversedEdges(final Graph<V,E> graph, final List<E> path1, final List<E> path2) {
  if (path1.size() == 0 || path2.size() == 0){
    return;
  } else {
    final V source = graph.getSource(path1.get(0));
    final V target = graph.getDest(path1.get(path1.size() - 1));
    for(final E edge2 : path2){
      for(final E edge1 : path1){
        if (edge1.equals(edge2)){
          if (graph.isSource(source, edge1) ||
              graph.isSource(source, edge2) ||
              graph.isDest(target, edge1) ||
              graph.isDest(target, edge2)){
            // Return only shortest path
            path2.clear();
            return;
          }
          path1.remove(edge1);
          path2.remove(edge2);
          break;
        }
      }
    }
  }
}

代码示例来源:origin: girtel/Net2Plan

for (E e2 : graph.getIncidentEdges(graph.getSource(e)))

代码示例来源:origin: net.sourceforge.ondex.apps/ovtk2

cluster.addEdge(edge, original.getSource(edge), original.getDest(edge));

代码示例来源:origin: girtel/Net2Plan

/** This method does the following length transformation:
   * 
   * <pre> c'(v,w) = c(v,w) - d (s,w) + d (s,v) </pre>
   * 
   * @param graph1 the graph
   * @param slTrans The shortest length transformer
   * @return the transformed graph
   * @since 0.3.0 */
  private Transformer<E, Double> lengthTransformation(Graph<V, E> graph1, Transformer<V, Number> slTrans)
  {
    SortedMap<E, Double> map = new TreeMap<E, Double>();
    for (E link : graph1.getEdges())
    {
      double newWeight;
      if (slTrans.transform(graph1.getSource(link)) == null)
      {
        newWeight = Double.MAX_VALUE;
      } else
      {
        newWeight = nev.transform(link) - slTrans.transform(graph1.getDest(link)).doubleValue() + slTrans.transform(graph1.getSource(link)).doubleValue();
        if (newWeight < 0 || newWeight > -1e-6) newWeight = 0; /* Numerical errors */
      }
      map.put(link, newWeight);
    }
    return MapTransformer.getInstance(map);
  }
}

代码示例来源:origin: org.opendaylight.nic/of-renderer

protected List<E> reverseUpdateEdgesWeight(final Graph<V, E> graph, final  Transformer<V, Number> transformer,
                      final List<E> shortestPath, final V initial, final V destination) {
  for(final E edge1 : shortestPath){
    V src = graph.getSource(edge1);
    V dst = graph.getDest(edge1);
    graph.removeEdge(edge1);
    graph.addEdge(edge1, dst, src, EdgeType.DIRECTED);
  }
  final List<E> edges = new ArrayList<>(graph.getEdges());
  final Map<E, Number> map = new LinkedHashMap<>();
  edges.forEach(edge -> {
    final V source = graph.getSource(edge);
    final V dest = graph.getDest(edge);
    Number cost = calculateCost(transformer, edge, source, dest);
    map.put(edge,cost);
  });
  final DijkstraShortestPath<V, E> reversedDijkstra =
      new DijkstraShortestPath<>(graph, MapTransformer.getInstance(map));
  DijkstraShortestPath<V, E> validatedShortestPath = checkPath(initial, destination, reversedDijkstra);
  return validatedShortestPath != null ? reversedDijkstra.getPath(initial, destination) : new ArrayList<>();
}

代码示例来源:origin: net.sourceforge.ondex.apps/ovtk2-default

ONDEXConcept source = graph.getSource(edge);
ONDEXConcept dest = graph.getDest(edge);

代码示例来源:origin: net.sourceforge.ondex.apps/ovtk2-default

graph.getSource(edge));
Point2D dest = viewer.getGraphLayout().transform(graph.getDest(edge));
xmlw.writeStartElement("y:Point");

代码示例来源:origin: net.sf.jung/jung-algorithms

V source = graph.getSource(e);
V dest = graph.getDest(e);
E to_add = create_new ? edge_factory.get() : e;

代码示例来源:origin: girtel/Net2Plan

/** This method reverse the path "path" in the graph "graph" and returns it.
 * 
 * @param graph the input graph which will not be changed.
 * @param path the path to reverse
 * @return a new graph with the reversed path
 * @since 0.3.0 */
private static <V, E> Graph<V, E> reverseEdges(Graph<V, E> graph, List<E> path)
{
  if (graph == null || path == null) throw new IllegalArgumentException();
  Graph<V, E> clone = new DirectedOrderedSparseMultigraph<V, E>();
  for (V v : graph.getVertices())
    clone.addVertex(v);
  for (E e : graph.getEdges())
    clone.addEdge(e, graph.getEndpoints(e));
  for (E link : path)
  {
    V src = clone.getSource(link);
    V dst = clone.getDest(link);
    clone.removeEdge(link);
    clone.addEdge(link, dst, src, EdgeType.DIRECTED);
  }
  return clone;
}

代码示例来源:origin: girtel/Net2Plan

Node originNode_thisLink = originalNodeId2AuxIdMapping.get(graph.getSource(edge));
Node destinationNode_thisLink = graph.getDest(edge);
auxGraph.addEdge(edge, originNode_thisLink, destinationNode_thisLink);

代码示例来源:origin: org.opendaylight.controller.thirdparty/net.sf.jung2

V source = graph.getSource(e);
V dest = graph.getDest(e);
E to_add = create_new ? edge_factory.create() : e;

代码示例来源:origin: geogebra/geogebra

} else // if the edge is directed, just add it
  V source = graph.getSource(e);
  V dest = graph.getDest(e);
  E to_add = create_new ? edge_factory.create() : e;

相关文章