edu.uci.ics.jung.random.generators
Class Lattice2DGenerator

java.lang.Object
  extended byedu.uci.ics.jung.random.generators.Lattice2DGenerator
All Implemented Interfaces:
GraphGenerator
Direct Known Subclasses:
KleinbergSmallWorldGenerator

public class Lattice2DGenerator
extends java.lang.Object
implements GraphGenerator

Simple generator of an n x n lattice where each vertex is incident with each of its 4 neighbors (except possibly for the vertices on the edge depending upon whether the lattice is specified to be toroidal or not).

Author:
Scott

Constructor Summary
Lattice2DGenerator(int latticeSize, boolean isToroidal)
          Constructs an instance of the lattice generator
 
Method Summary
 ArchetypeGraph generateGraph()
          Instructs the algorithm to generate the graph
 int getLatticeSize()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Lattice2DGenerator

public Lattice2DGenerator(int latticeSize,
                          boolean isToroidal)
Constructs an instance of the lattice generator

Parameters:
latticeSize - the size of the lattice, n, thus creating an n x n lattice.
isToroidal - whether the lattice wraps around or not
Method Detail

generateGraph

public ArchetypeGraph generateGraph()
Description copied from interface: GraphGenerator
Instructs the algorithm to generate the graph

Specified by:
generateGraph in interface GraphGenerator
Returns:
the generated graph

getLatticeSize

public int getLatticeSize()
Returns: