Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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

    java.lang.Object
      edu.uci.ics.jung.random.generators.Lattice2DGenerator

All Implemented Interfaces:
  GraphGenerator

Direct Known Subclasses:
  KleinbergSmallWorldGenerator

public class Lattice2DGenerator
extends 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
`protected int` | `downIndex(int currentLatticeRow, int currentLatticeColumn)`
`ArchetypeGraph` | `generateGraph()` Instructs the algorithm to generate the graph
`int` | `getLatticeSize()`
`protected int` | `leftIndex(int currentLatticeRow, int currentLatticeColumn)`
`protected int` | `rightIndex(int currentLatticeRow, int currentLatticeColumn)`
`protected int` | `upIndex(int currentLatticeRow, int currentLatticeColumn)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, 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

### upIndex

    protected int upIndex(int currentLatticeRow,
                          int currentLatticeColumn)

### downIndex

    protected int downIndex(int currentLatticeRow,
                            int currentLatticeColumn)

### leftIndex

    protected int leftIndex(int currentLatticeRow,
                            int currentLatticeColumn)

### rightIndex

    protected int rightIndex(int currentLatticeRow,
                             int currentLatticeColumn)

### getLatticeSize

    public int getLatticeSize()

  Returns:
    the size of the lattice, as specified by the constructor

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD