de.cesr.more.building.util
Class MLattice1DGenerator<V,E extends MoreEdge<? super V>>

java.lang.Object
  extended by de.cesr.more.building.util.MLattice1DGenerator<V,E>
All Implemented Interfaces:
GraphGenerator<V,E>, org.apache.commons.collections15.Factory<Graph<V,E>>

public class MLattice1DGenerator<V,E extends MoreEdge<? super V>>
extends Object
implements GraphGenerator<V,E>

MORe Considers MNetworkBuildingPa.BUILD_WSSM_CONSIDER_SOURCES (this class is mainly used by MSmallWorldBetaModelNetworkGenerator). NOTE: For undirected networks, the k provider values are not fully respected (because of links from other nodes that increase in-degree) TODO (see NOTE, also check if it is possible to distribute links across nodes to satisfy k provider values)

Date:
24.01.2011

Field Summary
protected  boolean considerSource
           
protected  MoreNetworkEdgeModifier<V,E> edge_modifier
           
protected  org.apache.commons.collections15.Factory<? extends MoreNetwork<V,E>> graph_factory
           
protected  boolean is_directed
           
protected  boolean is_symmetrical
           
protected  boolean is_toroidal
           
protected  MoreKValueProvider<V> kProvider
           
protected  int numVertices
           
protected  org.apache.commons.collections15.Factory<V> vertex_factory
           
 
Constructor Summary
MLattice1DGenerator(org.apache.commons.collections15.Factory<? extends MoreNetwork<V,E>> graph_factory, org.apache.commons.collections15.Factory<V> vertex_factory, MoreNetworkEdgeModifier<V,E> edge_modifier, int numVertices, MoreKValueProvider<V> kProvider, boolean isToroidal, boolean is_symmetrical)
          Constructs a generator of square lattices of size latticeSize with the specified parameters.
 
Method Summary
 Graph<V,E> create()
           
 MoreNetwork<V,E> createMoreNetwork()
           
protected  int getIndex(int i)
           
protected  V getVertex(int i)
          Returns the ith vertex (counting row-wise).
protected  int mod(int i, int modulus)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

numVertices

protected int numVertices

kProvider

protected MoreKValueProvider<V> kProvider

is_toroidal

protected boolean is_toroidal

is_directed

protected boolean is_directed

is_symmetrical

protected boolean is_symmetrical

graph_factory

protected org.apache.commons.collections15.Factory<? extends MoreNetwork<V,E extends MoreEdge<? super V>>> graph_factory

vertex_factory

protected org.apache.commons.collections15.Factory<V> vertex_factory

edge_modifier

protected MoreNetworkEdgeModifier<V,E extends MoreEdge<? super V>> edge_modifier

considerSource

protected boolean considerSource
Constructor Detail

MLattice1DGenerator

public MLattice1DGenerator(org.apache.commons.collections15.Factory<? extends MoreNetwork<V,E>> graph_factory,
                           org.apache.commons.collections15.Factory<V> vertex_factory,
                           MoreNetworkEdgeModifier<V,E> edge_modifier,
                           int numVertices,
                           MoreKValueProvider<V> kProvider,
                           boolean isToroidal,
                           boolean is_symmetrical)
Constructs a generator of square lattices of size latticeSize with the specified parameters.

Parameters:
graph_factory - used to create the Graph for the lattice
vertex_factory - used to create the lattice vertices (also defines order of vertices)
edge_modifier - used to create the lattice edges
numVertices -
kProvider -
isToroidal - if true, the created lattice wraps from top to bottom and left to right
is_symmetrical - if true, for every link another link of reverse direction is created
Method Detail

createMoreNetwork

public MoreNetwork<V,E> createMoreNetwork()
See Also:
Factory.create()

getIndex

protected int getIndex(int i)

mod

protected int mod(int i,
                  int modulus)

getVertex

protected V getVertex(int i)
Returns the ith vertex (counting row-wise).


create

public Graph<V,E> create()
Specified by:
create in interface org.apache.commons.collections15.Factory<Graph<V,E extends MoreEdge<? super V>>>
See Also:
Factory.create()