Class BananaTreeGenerator
java.lang.Object
org.graphstream.stream.SourceBase
org.graphstream.algorithm.generator.BaseGenerator
org.graphstream.algorithm.generator.BananaTreeGenerator
- All Implemented Interfaces:
Generator
,org.graphstream.stream.Source
public class BananaTreeGenerator extends BaseGenerator
Banana tree generator. A (n,k)-banana tree is composed of a root node and n
k-stars with one leaf of each star connected to the root node.
- Scientific Reference :
- Chen, W. C.; Lü, H. I.; and Yeh, Y. N. "Operations of Interlaced Trees and Graceful Trees." Southeast Asian Bull. Math. 21, 337-348, 1997.
-
Nested Class Summary
-
Constructor Summary
Constructors Constructor Description BananaTreeGenerator()
Build a new Banana tree generator with default star size.BananaTreeGenerator(int k)
Build a new Banana tree generator composing of k-stars. -
Method Summary
Modifier and Type Method Description void
begin()
Begin the graph generation.boolean
nextEvents()
Perform the next step in generating the graph.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
-
BananaTreeGenerator
public BananaTreeGenerator()Build a new Banana tree generator with default star size. -
BananaTreeGenerator
public BananaTreeGenerator(int k)Build a new Banana tree generator composing of k-stars.- Parameters:
k
- size of star
-
-
Method Details
-
begin
public void begin()Description copied from interface:Generator
Begin the graph generation. This usually is the place for initialization of the generator. After calling this method, call theGenerator.nextEvents()
method to add elements to the graph. -
nextEvents
public boolean nextEvents()Description copied from interface:Generator
Perform the next step in generating the graph. While this method returns true, there are still more elements to add to the graph to generate it. Be careful that some generators never return false here, since they can generate graphs of arbitrary size. For such generators, simply stop calling this method when enough elements have been generated. A call to this method can produce an undetermined number of nodes and edges. Checking nodes count is advisable when generating the graph to avoid an unwanted big graph.- Returns:
- true while there are elements to add to the graph.
-