de.cesr.more.building.util
Class MLattice1DGenerator<V,E extends MoreEdge<? super V>>
java.lang.Object
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
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. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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
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 latticevertex_factory
- used to create the lattice vertices (also defines order of vertices)edge_modifier
- used to create the lattice edgesnumVertices
- kProvider
- isToroidal
- if true, the created lattice wraps from top to bottom and left to rightis_symmetrical
- if true, for every link another link of reverse direction is created
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
i
th 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()