public class Lattice1DGenerator extends java.lang.Object implements GraphGenerator
Constructor and Description |
---|
Lattice1DGenerator(int numNodes,
boolean isToroidal)
Constructs an instance of the lattice generator
|
Modifier and Type | Method and Description |
---|---|
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
|
public Lattice1DGenerator(int numNodes, boolean isToroidal)
numNodes
- # of nodes in the generated graphisToroidal
- whether the lattice wraps around or notpublic 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.