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

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

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

Graph.getDefaultEdgeType介绍

暂无

代码示例

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

/**
 * @see edu.uci.ics.jung.graph.Graph#getDefaultEdgeType()
 */
public EdgeType getDefaultEdgeType() 
{
  return delegate.getDefaultEdgeType();
}

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

/**
 * @see edu.uci.ics.jung.graph.Graph#getDefaultEdgeType()
 */
@Override
public EdgeType getDefaultEdgeType() {
  return delegate.getDefaultEdgeType();
}

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

/**
 * @see edu.uci.ics.jung.graph.Graph#getDefaultEdgeType()
 */
public EdgeType getDefaultEdgeType()
{
  return delegate.getDefaultEdgeType();
}

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

/**
 * @see edu.uci.ics.jung.graph.Graph#getDefaultEdgeType()
 */
public EdgeType getDefaultEdgeType()
{
  return delegate.getDefaultEdgeType();
}

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

/**
 * @see edu.uci.ics.jung.graph.Graph#getDefaultEdgeType()
 */
@Override
public EdgeType getDefaultEdgeType() {
  return delegate.getDefaultEdgeType();
}

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

/**
 * @see edu.uci.ics.jung.graph.Graph#getDefaultEdgeType()
 */
@Override
public EdgeType getDefaultEdgeType() {
  return delegate.getDefaultEdgeType();
}

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

public EdgeType getDefaultEdgeType() {
  return graph.getDefaultEdgeType();
}
public V getDest(E directedEdge) {

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

/**
 * Creates a generator of {@code row_count} x {@code col_count} lattices 
 * with the specified parameters.
 * 
 * @param graph_factory used to create the {@code Graph} for the lattice
 * @param vertex_factory used to create the lattice vertices
 * @param edge_factory used to create the lattice edges
 * @param row_count the number of rows in the lattice
 * @param col_count the number of columns in the lattice
 * @param isToroidal if true, the created lattice wraps from top to bottom and left to right
 */
public Lattice2DGenerator(Supplier<? extends Graph<V,E>> graph_factory, Supplier<V> vertex_factory, 
    Supplier<E> edge_factory, int row_count, int col_count, boolean isToroidal)
{
  if (row_count < 2 || col_count < 2)
  {
    throw new IllegalArgumentException("Row and column counts must each be at least 2.");
  }
  this.row_count = row_count;
  this.col_count = col_count;
  this.is_toroidal = isToroidal;
  this.graph_factory = graph_factory;
  this.vertex_factory = vertex_factory;
  this.edge_factory = edge_factory;
  this.is_directed = (graph_factory.get().getDefaultEdgeType() == EdgeType.DIRECTED);
}

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

/**
 * Creates a generator of {@code row_count} x {@code col_count} lattices 
 * with the specified parameters.
 * 
 * @param graph_factory used to create the {@code Graph} for the lattice
 * @param vertex_factory used to create the lattice vertices
 * @param edge_factory used to create the lattice edges
 * @param row_count the number of rows in the lattice
 * @param col_count the number of columns in the lattice
 * @param isToroidal if true, the created lattice wraps from top to bottom and left to right
 */
public Lattice2DGenerator(Factory<? extends Graph<V,E>> graph_factory, Factory<V> vertex_factory, 
    Factory<E> edge_factory, int row_count, int col_count, boolean isToroidal)
{
  if (row_count < 2 || col_count < 2)
  {
    throw new IllegalArgumentException("Row and column counts must each be at least 2.");
  }
  this.row_count = row_count;
  this.col_count = col_count;
  this.is_toroidal = isToroidal;
  this.graph_factory = graph_factory;
  this.vertex_factory = vertex_factory;
  this.edge_factory = edge_factory;
  this.is_directed = (graph_factory.create().getDefaultEdgeType() == EdgeType.DIRECTED);
}

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

this.edge_factory = edge_factory;
this.is_directed = (graph_factory.create()
    .getDefaultEdgeType() == EdgeType.DIRECTED);

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

private void createRandomEdge(Collection<V> preexistingNodes, V newVertex, Set<Pair<V>> added_pairs,
    WeightedChoice<V> weightedProbabilities) {
  V attach_point;
  boolean created_edge = false;
  Pair<V> endpoints;
  do {
    attach_point = weightedProbabilities.nextItem();
    endpoints = new Pair<V>(newVertex, attach_point);
    /*
     * If parallel edges are not allowed, skip attach_point if
     * <newVertex, attach_point> already exists; note that because of
     * the way the new node's edges are added, we only need to check the
     * list of candidate edges for duplicates.
     */
    if (!(mGraph instanceof MultiGraph)) {
      if (added_pairs.contains(endpoints))
        continue;
      if (mGraph.getDefaultEdgeType() == EdgeType.UNDIRECTED
          && added_pairs.contains(new Pair<V>(attach_point, newVertex)))
        continue;
    }
    created_edge = true;
  } while (!created_edge);
  added_pairs.add(endpoints);
  if (mGraph.getDefaultEdgeType() == EdgeType.UNDIRECTED) {
    added_pairs.add(new Pair<V>(attach_point, newVertex));
  }
}

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

if (mGraph.getDefaultEdgeType() == EdgeType.UNDIRECTED && 
      added_pairs.contains(new Pair<V>(attach_point, newVertex)))
      continue;
if (mGraph.getDefaultEdgeType() == EdgeType.UNDIRECTED) {
  added_pairs.add(new Pair<V>(attach_point, newVertex));

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

continue;
    if (mGraph.getDefaultEdgeType() == EdgeType.UNDIRECTED
        && added_pairs
            .contains(new Pair<V>(attach_point, newVertex))) {
if (mGraph.getDefaultEdgeType() == EdgeType.UNDIRECTED) {
  added_pairs.add(new Pair<V>(attach_point, newVertex));

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

private void evolveGraph() {
  Collection<V> preexistingNodes = mGraph.getVertices();
  V newVertex = vertexFactory.get();
  mGraph.addVertex(newVertex);
  // generate and store the new edges; don't add them to the graph
  // yet because we don't want to bias the degree calculations
  // (all new edges in a timestep should be added in parallel)
  Set<Pair<V>> added_pairs = createRandomEdges(preexistingNodes, newVertex, mNumEdgesToAttachPerStep);
  for (Pair<V> pair : added_pairs) {
    V v1 = pair.getFirst();
    V v2 = pair.getSecond();
    if (mGraph.getDefaultEdgeType() != EdgeType.UNDIRECTED || !mGraph.isNeighbor(v1, v2))
      mGraph.addEdge(edgeFactory.get(), pair);
  }
  // now that we're done attaching edges to this new vertex,
  // add it to the index
  vertex_index.add(newVertex);
  index_vertex.put(newVertex, new Integer(vertex_index.size() - 1));
}

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

private void evolveGraph() {
  V newVertex = vertexFactory.create();
  mGraph.addVertex(newVertex);
  // generate and store the new edges; don't add them to the graph
  // yet because we don't want to bias the degree calculations
  // (all new edges in a timestep should be added in parallel)
  Set<Pair<V>> added_pairs = new HashSet<Pair<V>>(
      mNumEdgesToAttachPerStep * 3);
  for (int i = 0; i < mNumEdgesToAttachPerStep; i++) {
    createRandomEdge(newVertex, added_pairs);
  }
  for (Pair<V> pair : added_pairs) {
    V v1 = pair.getFirst();
    V v2 = pair.getSecond();
    if (mGraph.getDefaultEdgeType() != EdgeType.UNDIRECTED
        || !mGraph.isNeighbor(v1, v2)) {
      mGraph.addEdge(edgeFactory.create(), pair);
    }
  }
  // now that we're done attaching edges to this new vertex,
  // add it to the index
  vertex_index.add(newVertex);
  index_vertex.put(newVertex, Integer.valueOf(vertex_index.size() - 1));
}

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

private void evolveGraph() {
  Collection<V> preexistingNodes = mGraph.getVertices();
  V newVertex = vertexFactory.create();
  mGraph.addVertex(newVertex);
  // generate and store the new edges; don't add them to the graph
  // yet because we don't want to bias the degree calculations
  // (all new edges in a timestep should be added in parallel)
  Set<Pair<V>> added_pairs = new HashSet<Pair<V>>(mNumEdgesToAttachPerStep*3);
  
  for (int i = 0; i < mNumEdgesToAttachPerStep; i++) 
    createRandomEdge(preexistingNodes, newVertex, added_pairs);
  
  for (Pair<V> pair : added_pairs)
  {
    V v1 = pair.getFirst();
    V v2 = pair.getSecond();
    if (mGraph.getDefaultEdgeType() != EdgeType.UNDIRECTED || 
        !mGraph.isNeighbor(v1, v2))
      mGraph.addEdge(edgeFactory.create(), pair);
  }
  // now that we're done attaching edges to this new vertex, 
  // add it to the index
  vertex_index.add(newVertex);
  index_vertex.put(newVertex, new Integer(vertex_index.size() - 1));
}

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

if (graph.getDefaultEdgeType() == EdgeType.DIRECTED)

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

if (mGraph.getDefaultEdgeType() == EdgeType.UNDIRECTED) {
  degree = mGraph.degree(v);
  denominator = (2 * mGraph.getEdgeCount()) + mGraph.getVertexCount() - 1;

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

if (graph.getDefaultEdgeType() == EdgeType.DIRECTED)

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

if (graph.getDefaultEdgeType() == EdgeType.DIRECTED) {

相关文章