|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.uci.ics.jung.algorithms.generators.Lattice2DGenerator<V,E>
public class Lattice2DGenerator<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 factory supplied has a default edge type of EdgeType.DIRECTED
,
then edges will be created in both directions between adjacent vertices.
Field Summary | |
---|---|
protected int |
col_count
|
protected |
edge_factory
|
protected |
graph_factory
|
protected boolean |
is_directed
|
protected boolean |
is_toroidal
|
protected int |
row_count
|
protected |
vertex_factory
|
Constructor Summary | |
---|---|
Lattice2DGenerator(
Constructs a generator of square lattices of size latticeSize
with the specified parameters. |
|
Lattice2DGenerator(
Creates a generator of row_count x col_count lattices
with the specified parameters. |
Method Summary | |
---|---|
Graph<V,E> |
create()
|
protected int |
getCol(int i)
Returns the column in which vertex i is found. |
int |
getGridEdgeCount()
Returns the number of edges found in a lattice of this generator's specifications. |
protected int |
getIndex(int i,
int j)
|
protected int |
getRow(int i)
Returns the row in which vertex i is found. |
protected V |
getVertex(int i)
Returns the i th vertex (counting row-wise). |
protected V |
getVertex(int i,
int j)
Returns the vertex at position ( i mod row_count, j mod col_count ). |
protected int |
mod(int i,
int modulus)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected int row_count
protected int col_count
protected boolean is_toroidal
protected boolean is_directed
protectedgraph_factory
protectedvertex_factory
protectededge_factory
Constructor Detail |
---|
public Lattice2DGenerator(graph_factory, vertex_factory, edge_factory, int latticeSize, boolean isToroidal)
latticeSize
with the specified parameters.
graph_factory
- used to create the Graph
for the latticevertex_factory
- used to create the lattice verticesedge_factory
- used to create the lattice edgeslatticeSize
- the number of rows and columns of the latticeisToroidal
- if true, the created lattice wraps from top to bottom and left to rightpublic Lattice2DGenerator(graph_factory, vertex_factory, edge_factory, int row_count, int col_count, boolean isToroidal)
row_count
x col_count
lattices
with the specified parameters.
graph_factory
- used to create the Graph
for the latticevertex_factory
- used to create the lattice verticesedge_factory
- used to create the lattice edgesrow_count
- the number of rows in the latticecol_count
- the number of columns in the latticeisToroidal
- if true, the created lattice wraps from top to bottom and left to rightMethod Detail |
---|
public Graph<V,E> create()
edu.uci.ics.jung.algorithms.generators.GraphGenerator#create()
public int getGridEdgeCount()
protected int getIndex(int i, int j)
protected int mod(int i, int modulus)
protected V getVertex(int i, int j)
i mod row_count, j mod col_count
).
protected V getVertex(int i)
i
th vertex (counting row-wise).
protected int getRow(int i)
i
is found.
protected int getCol(int i)
i
is found.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |