Class Lattice1DGenerator<T>

  • All Implemented Interfaces:

    public class Lattice1DGenerator<T>
    extends AbstractGenerator<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

    Nick Collier, Jung Project
    • Constructor Detail

      • Lattice1DGenerator

        public Lattice1DGenerator​(boolean toroidal,
                                  boolean symmetrical)
        Creates a Lattice1DGenerator.
        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 Detail

      • createNetwork

        public Network<T> createNetwork​(Network<T> network)
        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.
        network - the network to rewire
        the created network
      • downIndex

        protected int downIndex​(int currentIndex)