org.graffiti.plugins.algorithms.generators
Class RandomGraphGenerator

java.lang.Object
  extended by org.graffiti.plugin.AbstractParametrizable
      extended by org.graffiti.plugin.algorithm.AbstractAlgorithm
          extended by org.graffiti.plugins.algorithms.generators.AbstractGenerator
              extended by org.graffiti.plugins.algorithms.generators.RandomGraphGenerator
All Implemented Interfaces:
Algorithm, Parametrizable

public class RandomGraphGenerator
extends AbstractGenerator

This generator creates a graph with n nodes and m edges. The user can choose, if the graph is directed, if the graph can be a multi graph, if self loops are allowed, if the nodes and the edges should be labeled.


Field Summary
 
Fields inherited from class org.graffiti.plugins.algorithms.generators.AbstractGenerator
DYNAMIC_CIRCLE, RANDOM, STATIC_CIRCLE
 
Constructor Summary
RandomGraphGenerator()
          Constructs a new instance.
 
Method Summary
 void check()
          Checks whether all preconditions of the current graph are satisfied.
 void execute()
          Executes the whole algorithm.
 String getName()
          Returns the name (id) of this Parametrizable.
 int getNumOfEdges()
          Returns the numOfEdges.
 int getNumOfNodes()
          Returns the numOfNodes.
 boolean isDirected()
          Returns the directed.
 boolean isMultiGraph()
          Returns the multiGraph.
 boolean isSelfLoops()
          Returns the selfLoops.
 void reset()
          Resets the internal state of the algorithm.
 void setAlgorithmParameters(Parameter<?>[] params)
           
 void setDirected(boolean directed)
          Sets the directed.
 void setMultiGraph(boolean multiGraph)
          Sets the multiGraph.
 void setNumOfEdges(int numOfEdges)
          Sets the numOfEdges.
 void setNumOfNodes(int numOfNodes)
          Sets the numOfNodes.
 void setSelfLoops(boolean selfLoops)
          Sets the selfLoops.
 
Methods inherited from class org.graffiti.plugins.algorithms.generators.AbstractGenerator
getAlgorithmParameters
 
Methods inherited from class org.graffiti.plugin.algorithm.AbstractAlgorithm
attach, getAnimation, supportsAnimation
 
Methods inherited from class org.graffiti.plugin.AbstractParametrizable
copyParameters, getDefaultParameters, getParameters, getUserParameters, saveUserParameters, saveUserParameters, setParameters
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.graffiti.plugin.Parametrizable
getDefaultParameters, getParameters, setParameters
 

Constructor Detail

RandomGraphGenerator

public RandomGraphGenerator()
Constructs a new instance.

Method Detail

getName

public String getName()
Description copied from interface: org.graffiti.plugin.Parametrizable
Returns the name (id) of this Parametrizable.

Returns:
DOCUMENT ME!
See Also:
Parametrizable.getName()

setAlgorithmParameters

public void setAlgorithmParameters(Parameter<?>[] params)
See Also:
AbstractParametrizable.setAlgorithmParameters(Parameter[])

check

public void check()
           throws PreconditionException
Description copied from interface: org.graffiti.plugin.algorithm.Algorithm
Checks whether all preconditions of the current graph are satisfied.

Specified by:
check in interface Algorithm
Overrides:
check in class AbstractAlgorithm
Throws:
PreconditionException - if the preconditions of the current graph are not satisfied.
See Also:
Algorithm.check()

execute

public void execute()
Description copied from interface: org.graffiti.plugin.algorithm.Algorithm
Executes the whole algorithm.

See Also:
Algorithm.execute()

reset

public void reset()
Description copied from interface: org.graffiti.plugin.algorithm.Algorithm
Resets the internal state of the algorithm.

Specified by:
reset in interface Algorithm
Overrides:
reset in class AbstractGenerator
See Also:
Algorithm.reset()

isDirected

public boolean isDirected()
Returns the directed.

Returns:
the directed.

setDirected

public void setDirected(boolean directed)
Sets the directed.

Parameters:
directed - the directed to set.

isMultiGraph

public boolean isMultiGraph()
Returns the multiGraph.

Returns:
the multiGraph.

setMultiGraph

public void setMultiGraph(boolean multiGraph)
Sets the multiGraph.

Parameters:
multiGraph - the multiGraph to set.

getNumOfEdges

public int getNumOfEdges()
Returns the numOfEdges.

Returns:
the numOfEdges.

setNumOfEdges

public void setNumOfEdges(int numOfEdges)
Sets the numOfEdges.

Parameters:
numOfEdges - the numOfEdges to set.

getNumOfNodes

public int getNumOfNodes()
Returns the numOfNodes.

Returns:
the numOfNodes.

setNumOfNodes

public void setNumOfNodes(int numOfNodes)
Sets the numOfNodes.

Parameters:
numOfNodes - the numOfNodes to set.

isSelfLoops

public boolean isSelfLoops()
Returns the selfLoops.

Returns:
the selfLoops.

setSelfLoops

public void setSelfLoops(boolean selfLoops)
Sets the selfLoops.

Parameters:
selfLoops - the selfLoops to set.


Generated at 2012-05-30 11:01:25 PM CEST