org.wilmascope.graphgen.plugin
Class RandomGraphGenerator
java.lang.Object
org.wilmascope.graphgen.GraphGenerator
org.wilmascope.graphgen.plugin.RandomGraphGenerator
- All Implemented Interfaces:
- org.wilmascope.util.Plugin
public class RandomGraphGenerator
- extends GraphGenerator
Generates a random (connected) graph with (up to) a specified number of nodes
and edges with random node positions in either 2 or 3 dimensions.
The algorithm is extremely simplistic:
- create the specified number of nodes
- for each node randomly pick another and create an edge between them
- delete disconnected nodes
- Author:
- dwyer
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RandomGraphGenerator
public RandomGraphGenerator()
- set up controlPanel with controls for setting parameters
getName
public java.lang.String getName()
generate
public void generate(GraphControl gc)
- Generate the random graph
- Specified by:
generate
in class GraphGenerator
- Parameters:
gc
- the instance of GraphControl inwhich the graph will be generated- See Also:
org.wilmascope.graphgen.GraphModifier#generate(org.wilmascope.control.GraphControl)
createLayeredDirectedAcyclicGraph
public void createLayeredDirectedAcyclicGraph(GraphControl graphControl)
getControls
public javax.swing.JPanel getControls()