Class Lattice1DGenerator<T>
java.lang.Object
repast.simphony.context.space.graph.AbstractGenerator<T>
repast.simphony.context.space.graph.Lattice1DGenerator<T>
- All Implemented Interfaces:
NetworkGenerator<T>
Creates a n x 1 lattice where each vertex is incident to
two neighbors (except at the edges if the lattice is non-toroidal.)
Based on Jung Lattice1DGenerator
- Author:
- Nick Collier, Jung Project
-
Field Summary
Fields inherited from class repast.simphony.context.space.graph.AbstractGenerator
msg
-
Constructor Summary
ConstructorDescriptionLattice1DGenerator
(boolean toroidal, boolean symmetrical) Creates a Lattice1DGenerator. -
Method Summary
-
Constructor Details
-
Lattice1DGenerator
public Lattice1DGenerator(boolean toroidal, boolean symmetrical) Creates a Lattice1DGenerator.- Parameters:
toroidal
- whether lattice wraps or not.symmetrical
- whether the lattice is symmetrical (edges are bi-directional). Note this only matters for a directed network.
-
-
Method Details
-
createNetwork
Given an existing network, add edges to create a n x 1 lattice. The lattice dimension n is the number of nodes in the specified network.- Parameters:
network
- the network to rewire- Returns:
- the created network
-
downIndex
protected int downIndex(int currentIndex)
-