Class FullGenerator
- All Implemented Interfaces:
Generator
,org.graphstream.stream.Source
public class FullGenerator extends BaseGenerator
Probably not very useful, still sometimes needed. This generator creates
fully connected graphs of any size. Calling begin()
put one unique
node in the graph, then nextEvents()
will add a new node each time
it is called.
This generator has the ability to add randomly chosen numerical values on arbitrary attributes on edges or nodes of the graph, and to randomly choose a direction for edges.
A list of attributes can be given for nodes and edges. In this case each new node or edge added will have this attribute and the value will be a randomly chosen number. The range in which these numbers are chosen can be specified.
By default, edges are not oriented. It is possible to ask orientation, in which case the direction is chosen randomly.
- Since:
- 2007
-
Nested Class Summary
-
Constructor Summary
Constructors Constructor Description FullGenerator()
New full graph generator.FullGenerator(boolean directed, boolean randomlyDirectedEdges)
New full graph generator.FullGenerator(boolean directed, boolean randomlyDirectedEdges, String nodeAttribute, String edgeAttribute)
New full graph generator. -
Method Summary
Modifier and Type Method Description void
begin()
Begin the generator by adding a node.boolean
nextEvents()
Add a new node and connect it with all others.Methods inherited from class org.graphstream.algorithm.generator.BaseGenerator
addEdgeAttribute, addEdgeAttribute, addEdgeAttribute, addEdgeLabels, addNodeAttribute, addNodeAttribute, addNodeAttribute, addNodeLabels, end, isUsingInternalGraph, removeEdgeAttribute, removeNodeAttribute, setDirectedEdges, setRandomSeed, setUseInternalGraph
Methods inherited from class org.graphstream.stream.SourceBase
addAttributeSink, addElementSink, addSink, attributeSinks, clearAttributeSinks, clearElementSinks, clearSinks, elementSinks, removeAttributeSink, removeElementSink, removeSink, sendAttributeChangedEvent, sendAttributeChangedEvent, sendEdgeAdded, sendEdgeAdded, sendEdgeAttributeAdded, sendEdgeAttributeAdded, sendEdgeAttributeChanged, sendEdgeAttributeChanged, sendEdgeAttributeRemoved, sendEdgeAttributeRemoved, sendEdgeRemoved, sendEdgeRemoved, sendGraphAttributeAdded, sendGraphAttributeAdded, sendGraphAttributeChanged, sendGraphAttributeChanged, sendGraphAttributeRemoved, sendGraphAttributeRemoved, sendGraphCleared, sendGraphCleared, sendNodeAdded, sendNodeAdded, sendNodeAttributeAdded, sendNodeAttributeAdded, sendNodeAttributeChanged, sendNodeAttributeChanged, sendNodeAttributeRemoved, sendNodeAttributeRemoved, sendNodeRemoved, sendNodeRemoved, sendStepBegins, sendStepBegins
-
Constructor Details
-
FullGenerator
public FullGenerator()New full graph generator. By default no attributes are added to nodes and edges, and edges are not directed. -
FullGenerator
public FullGenerator(boolean directed, boolean randomlyDirectedEdges)New full graph generator.- Parameters:
directed
- Are edge directed?randomlyDirectedEdges
- randomly direct generated edges.
-
FullGenerator
public FullGenerator(boolean directed, boolean randomlyDirectedEdges, String nodeAttribute, String edgeAttribute)New full graph generator.- Parameters:
directed
- Are edge directed?.randomlyDirectedEdges
- randomly direct generated edges.nodeAttribute
- put an attribute by that name on each node with a random numeric value.edgeAttribute
- put an attribute by that name on each edge with a random numeric value.
-
-
Method Details
-
begin
public void begin()Begin the generator by adding a node.- See Also:
Generator.begin()
-
nextEvents
public boolean nextEvents()Add a new node and connect it with all others.- Returns:
- true while there are elements to add to the graph.
- See Also:
Generator.nextEvents()
-