public class KleinbergSmallWorldGenerator<V,E> extends Lattice2DGenerator<V,E>
col_count, edge_factory, graph_factory, is_directed, is_toroidal, row_count, vertex_factory
Constructor and Description |
---|
KleinbergSmallWorldGenerator(com.google.common.base.Supplier<? extends Graph<V,E>> graphFactory,
com.google.common.base.Supplier<V> vertexFactory,
com.google.common.base.Supplier<E> edgeFactory,
int latticeSize,
double clusteringExponent)
Creates an instance with the specified parameters, whose underlying lattice is (a) of size
latticeSize x latticeSize , and (b) toroidal. |
KleinbergSmallWorldGenerator(com.google.common.base.Supplier<? extends Graph<V,E>> graphFactory,
com.google.common.base.Supplier<V> vertexFactory,
com.google.common.base.Supplier<E> edgeFactory,
int row_count,
int col_count,
double clusteringExponent)
Creates an instance with the specified parameters, whose underlying lattice is toroidal.
|
KleinbergSmallWorldGenerator(com.google.common.base.Supplier<? extends Graph<V,E>> graphFactory,
com.google.common.base.Supplier<V> vertexFactory,
com.google.common.base.Supplier<E> edgeFactory,
int row_count,
int col_count,
double clusteringExponent,
boolean isToroidal)
Creates an instance with the specified parameters.
|
Modifier and Type | Method and Description |
---|---|
Graph<V,E> |
get()
Generates a random small world network according to the parameters given
|
int |
getConnectionCount() |
void |
setConnectionCount(int num_connections)
Sets the number of new 'small-world' connections (outgoing edges) to be added to each vertex.
|
void |
setRandom(Random random)
Sets the
Random instance used by this instance. |
void |
setRandomSeed(long seed)
Sets the seed of the internal random number generator.
|
getCol, getGridEdgeCount, getIndex, getRow, getVertex, getVertex, mod
public KleinbergSmallWorldGenerator(com.google.common.base.Supplier<? extends Graph<V,E>> graphFactory, com.google.common.base.Supplier<V> vertexFactory, com.google.common.base.Supplier<E> edgeFactory, int latticeSize, double clusteringExponent)
latticeSize
x latticeSize
, and (b) toroidal.graphFactory
- factory for graphs of the appropriate typevertexFactory
- factory for vertices of the appropriate typeedgeFactory
- factory for edges of the appropriate typelatticeSize
- the number of rows and columns of the underlying latticeclusteringExponent
- the clustering exponentpublic KleinbergSmallWorldGenerator(com.google.common.base.Supplier<? extends Graph<V,E>> graphFactory, com.google.common.base.Supplier<V> vertexFactory, com.google.common.base.Supplier<E> edgeFactory, int row_count, int col_count, double clusteringExponent)
graphFactory
- factory for graphs of the appropriate typevertexFactory
- factory for vertices of the appropriate typeedgeFactory
- factory for edges of the appropriate typerow_count
- number of rows of the underlying latticecol_count
- number of columns of the underlying latticeclusteringExponent
- the clustering exponentpublic KleinbergSmallWorldGenerator(com.google.common.base.Supplier<? extends Graph<V,E>> graphFactory, com.google.common.base.Supplier<V> vertexFactory, com.google.common.base.Supplier<E> edgeFactory, int row_count, int col_count, double clusteringExponent, boolean isToroidal)
graphFactory
- factory for graphs of the appropriate typevertexFactory
- factory for vertices of the appropriate typeedgeFactory
- factory for edges of the appropriate typerow_count
- number of rows of the underlying latticecol_count
- number of columns of the underlying latticeclusteringExponent
- the clustering exponentisToroidal
- whether the underlying lattice is toroidalpublic void setRandom(Random random)
Random
instance used by this instance. Useful for
unit testing.random
- the Random
instance for this class to usepublic void setRandomSeed(long seed)
seed
- the random seed that this class's random number generator is to usepublic void setConnectionCount(int num_connections)
num_connections
- the number of outgoing small-world edges to add to each vertexpublic int getConnectionCount()
Copyright © 2015. All rights reserved.