- java.lang.Object
-
- org.jgrapht.alg.drawing.BaseLayoutAlgorithm2D<V,E>
-
- org.jgrapht.alg.drawing.RandomLayoutAlgorithm2D<V,E>
-
- Type Parameters:
V
- the vertex typeE
- the edge type
- All Implemented Interfaces:
LayoutAlgorithm2D<V,E>
public class RandomLayoutAlgorithm2D<V,E> extends BaseLayoutAlgorithm2D<V,E>
Random layout. The algorithm assigns vertex coordinates uniformly at random.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Random
rng
-
Fields inherited from class org.jgrapht.alg.drawing.BaseLayoutAlgorithm2D
initializer
-
-
Constructor Summary
Constructors Constructor Description RandomLayoutAlgorithm2D()
Create a new layout algorithmRandomLayoutAlgorithm2D(long seed)
Create a new layout algorithmRandomLayoutAlgorithm2D(java.util.Random rng)
Create a new layout algorithm
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
layout(Graph<V,E> graph, LayoutModel2D<V> model)
Layout a graph.-
Methods inherited from class org.jgrapht.alg.drawing.BaseLayoutAlgorithm2D
getInitializer, init, setInitializer
-
-
-
-
Constructor Detail
-
RandomLayoutAlgorithm2D
public RandomLayoutAlgorithm2D()
Create a new layout algorithm
-
RandomLayoutAlgorithm2D
public RandomLayoutAlgorithm2D(long seed)
Create a new layout algorithm- Parameters:
seed
- seed for the random number generator
-
RandomLayoutAlgorithm2D
public RandomLayoutAlgorithm2D(java.util.Random rng)
Create a new layout algorithm- Parameters:
rng
- the random number generator
-
-
Method Detail
-
layout
public void layout(Graph<V,E> graph, LayoutModel2D<V> model)
Description copied from interface:LayoutAlgorithm2D
Layout a graph.- Parameters:
graph
- the graphmodel
- the layout model to use
-
-