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

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

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

Graph.getVertices介绍

暂无

代码示例

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

/**
 * @see edu.uci.ics.jung.graph.Hypergraph#getVertices()
 */
public synchronized Collection<V> getVertices() {
  return delegate.getVertices();
}

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

/**
 * @see edu.uci.ics.jung.graph.Hypergraph#getVertices()
 */
@Override
public synchronized Collection<V> getVertices() {
  return delegate.getVertices();
}

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

/**
 * @see edu.uci.ics.jung.graph.Hypergraph#getVertices()
 */
@Override
public Collection<V> getVertices() {
  return delegate.getVertices();
}

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

/**
 * @see edu.uci.ics.jung.graph.Hypergraph#getVertices()
 */
@Override
public Collection<V> getVertices() {
  return delegate.getVertices();
}

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

/**
 * Returns all vertices of the graph.
 * @return The collection of vertices.
 */
public Collection getVertices()
{
  return delegate.getVertices();
}

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

/**
 * @see edu.uci.ics.jung.graph.Hypergraph#getVertices()
 */
public Collection<V> getVertices() {
  return delegate.getVertices();
}

代码示例来源:origin: OpenNMS/opennms

private Set<V> getRoots() {
  Set<V> roots = graph.getVertices().stream()
      .filter(v -> graph.getInEdges(v).isEmpty())
      // Preserve the order of the roots
      .collect(Collectors.toCollection(LinkedHashSet::new));
  return roots;
}

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

/**
 * Returns the root of each tree of this forest as a {@code Collection}.
 */
public Collection<V> getRoots() {
  Collection<V> roots = new HashSet<V>();
  for (V v : delegate.getVertices()) {
    if (delegate.getPredecessorCount(v) == 0) {
      roots.add(v);
    }
  }
  return roots;
}

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

protected void initialize(Graph<V, E> graph) {
  this.graph = graph;
  this.vertex_scores = new HashMap<V, Double>();
  this.edge_scores = new HashMap<E, Double>();
  this.vertex_data = new HashMap<V, BetweennessData>();
  for (V v : graph.getVertices()) {
    this.vertex_scores.put(v, 0.0);
  }
  for (E e : graph.getEdges()) {
    this.edge_scores.put(e, 0.0);
  }
}

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

/**
 * @return the root of each tree of this forest as a {@code Collection}.
 */
public Collection<V> getRoots() {
  Collection<V> roots = new HashSet<V>();
  for(V v : delegate.getVertices()) {
    if(delegate.getPredecessorCount(v) == 0) {
      roots.add(v);
    }
  }
  return roots;
}

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

/**
 * Creates an instance for the specified graph and alpha (random jump probability)
 * parameter.  The edge weights are all set to 1.
 * @param g the input graph
 * @param alpha the probability of a hub giving some authority to all vertices,
 * and of an authority increasing the score of all hubs (not just those connected
 * via links)
 */
public HITS(Graph<V,E> g, double alpha)
{
  super(g, ScoringUtils.getHITSUniformRootPrior(g.getVertices()), alpha);
}

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

protected void initialize(Graph<V,E> graph)
{
  this.graph = graph;
  this.vertex_scores = new HashMap<V, Double>();
  this.edge_scores = new HashMap<E, Double>();
  this.vertex_data = new HashMap<V, BetweennessData>();
  
  for (V v : graph.getVertices())
    this.vertex_scores.put(v, 0.0);
  
  for (E e : graph.getEdges())
    this.edge_scores.put(e, 0.0);
}

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

/**
 * Sets the order of the vertices in the layout according to the ordering
 * specified by {@code comparator}.
 */
public void setVertexOrder(Comparator<V> comparator)
{
  if (vertex_ordered_list == null)
    vertex_ordered_list = new ArrayList<V>(getGraph().getVertices());
  Collections.sort(vertex_ordered_list, comparator);
}

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

/**
 * Sets the order of the vertices in the layout according to the ordering
 * of {@code vertex_list}.
 */
public void setVertexOrder(List<V> vertex_list)
{
  if (!vertex_list.containsAll(getGraph().getVertices())) 
    throw new IllegalArgumentException("Supplied list must include " +
        "all vertices of the graph");
  this.vertex_ordered_list = vertex_list;
}

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

/**
   * Locks all vertices in place if {@code lock} is {@code true}, otherwise unlocks all vertices.
   */
  public void lock(boolean lock) {
    for(V v : graph.getVertices()) {
      lock(v, lock);
    }
  }
}

代码示例来源:origin: OpenNMS/opennms

@Override
public boolean done() {
  return
      // if we have no objects in our graph to layout we are done:
      (getGraph().getEdges().isEmpty() && getGraph().getVertices().isEmpty())
     || m_alpha < 0.005;
}

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

private void cleanUp() {
  vertices.clear();
  edges.clear();
  for(V v : graph.getVertices()) {
    checkVertex(v);
  }
  for(E e : graph.getEdges()) {
    checkEdge(e);
  }
}

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

/**
 * This method calls <tt>initialize_local_vertex</tt> for each vertex, and
 * also adds initial coordinate information for each vertex. (The vertex's
 * initial location is set by calling <tt>initializeLocation</tt>.
 */
protected void initializeLocations() {
  for(V v : getGraph().getVertices()) {
    Point2D coord = delegate.apply(v);
    if (!dontmove.contains(v))
      initializeLocation(v, coord);
  }
}

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

/**
 * create an instance with a passed layout
 * create containers for graph components
 * @param layout the layout whose positions are to be persisted
 */
public PersistentLayoutImpl(Layout<V,E> layout) {
  super(layout);
this.locations = Maps.asMap(
  ImmutableSet.copyOf(layout.getGraph().getVertices()),
  new RandomPointFactory<V>(getSize()));
  this.dontmove = new HashSet<V>();
}

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

@Override
public void setSize(Dimension size) {
  super.setSize(size);
  for(V v : getGraph().getVertices()) {
    initializeLocation(v,apply(v),getSize());
  }
}

相关文章