Documentation of 'edu.uci.ics.jung.algorithms.generators.Lattice2DGenerator' Java class
Lattice2DGenerator
edu.uci.ics.jung.algorithms.generators

Class Lattice2DGenerator<V,E>

  • All Implemented Interfaces:
    com.google.common.base.Supplier<Graph<V,E>>, GraphGenerator<V,E>
    Direct Known Subclasses:
    KleinbergSmallWorldGenerator


    public class Lattice2DGenerator<V,E>
    extends java.lang.Object
    implements GraphGenerator<V,E>
    Simple generator of an m x n lattice where each vertex is incident with each of its neighbors (to the left, right, up, and down). May be toroidal, in which case the vertices on the edges are connected to their counterparts on the opposite edges as well.

    If the graph Supplier supplied has a default edge type of EdgeType.DIRECTED, then edges will be created in both directions between adjacent vertices.

    • Constructor Summary

      Constructors 
      Constructor and Description
      Lattice2DGenerator(com.google.common.base.Supplier<? extends Graph<V,E>> graph_factory, com.google.common.base.Supplier<V> vertex_factory, com.google.common.base.Supplier<E> edge_factory, int latticeSize, boolean isToroidal)
      Constructs a generator of square lattices of size latticeSize with the specified parameters.
      Lattice2DGenerator(com.google.common.base.Supplier<? extends Graph<V,E>> graph_factory, com.google.common.base.Supplier<V> vertex_factory, com.google.common.base.Supplier<E> edge_factory, int row_count, int col_count, boolean isToroidal)
      Creates a generator of row_count x col_count lattices with the specified parameters.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      Graph<V,E> get()
      Generates a graph based on the constructor-specified settings.
      int getGridEdgeCount()
      Returns the number of edges found in a lattice of this generator's specifications.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Lattice2DGenerator

        public Lattice2DGenerator(com.google.common.base.Supplier<? extends Graph<V,E>> graph_factory,
                                  com.google.common.base.Supplier<V> vertex_factory,
                                  com.google.common.base.Supplier<E> edge_factory,
                                  int latticeSize,
                                  boolean isToroidal)
        Constructs a generator of square lattices of size latticeSize with the specified parameters.
        Parameters:
        graph_factory - used to create the Graph for the lattice
        vertex_factory - used to create the lattice vertices
        edge_factory - used to create the lattice edges
        latticeSize - the number of rows and columns of the lattice
        isToroidal - if true, the created lattice wraps from top to bottom and left to right
      • Lattice2DGenerator

        public Lattice2DGenerator(com.google.common.base.Supplier<? extends Graph<V,E>> graph_factory,
                                  com.google.common.base.Supplier<V> vertex_factory,
                                  com.google.common.base.Supplier<E> edge_factory,
                                  int row_count,
                                  int col_count,
                                  boolean isToroidal)
        Creates a generator of row_count x col_count lattices with the specified parameters.
        Parameters:
        graph_factory - used to create the Graph for the lattice
        vertex_factory - used to create the lattice vertices
        edge_factory - used to create the lattice edges
        row_count - the number of rows in the lattice
        col_count - the number of columns in the lattice
        isToroidal - if true, the created lattice wraps from top to bottom and left to right
    • Method Detail

      • get

        public Graph<V,E> get()
        Generates a graph based on the constructor-specified settings.
        Specified by:
        get in interface com.google.common.base.Supplier<Graph<V,E>>
        Returns:
        the generated graph
      • getGridEdgeCount

        public int getGridEdgeCount()
        Returns the number of edges found in a lattice of this generator's specifications. (This is useful for subclasses that may modify the generated graphs to add more edges.)
        Returns:
        the number of edges that this generator will generate

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.