Class FullGenerator

java.lang.Object
org.graphstream.stream.SourceBase
org.graphstream.algorithm.generator.BaseGenerator
org.graphstream.algorithm.generator.FullGenerator
All Implemented Interfaces:
Generator, org.graphstream.stream.Source

public class FullGenerator
extends BaseGenerator
Full graph generator.

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

    Nested classes/interfaces inherited from class org.graphstream.stream.SourceBase

    org.graphstream.stream.SourceBase.ElementType
  • 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.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

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.graphstream.stream.Source

    addAttributeSink, addElementSink, addSink, clearAttributeSinks, clearElementSinks, clearSinks, removeAttributeSink, removeElementSink, removeSink
  • 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()