|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.uci.ics.jung.random.generators.Lattice1DGenerator
public class Lattice1DGenerator
Simple generator of an n x 1 lattice where each vertex is incident with each of its 2 neighbors (except possibly for the vertices on the edge depending upon whether the lattice is specified to be toroidal or not).
Constructor Summary | |
---|---|
Lattice1DGenerator(int numNodes,
boolean isToroidal)
Constructs an instance of the lattice generator |
Method Summary | |
---|---|
protected int |
downIndex(int currentIndex,
int numSteps)
Determines the vertices with a smaller index that are in the neighborhood of currentIndex. |
ArchetypeGraph |
generateGraph()
Instructs the algorithm to generate the graph |
protected int |
upIndex(int currentIndex,
int numSteps)
Determines the index of the neighbor ksteps above |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Lattice1DGenerator(int numNodes, boolean isToroidal)
numNodes
- # of nodes in the generated graphisToroidal
- whether the lattice wraps around or notMethod Detail |
---|
public ArchetypeGraph generateGraph()
GraphGenerator
generateGraph
in interface GraphGenerator
protected int downIndex(int currentIndex, int numSteps)
numSteps
- indicates the number of steps away from the current index that are being considered.currentIndex
- the index of the selected vertex.protected int upIndex(int currentIndex, int numSteps)
numSteps
- is the number of steps away from the current index that is being considered.currentIndex
- the index of the selected vertex.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |