org.graphstream.algorithm.generator
Interface Generator

All Superinterfaces:
org.graphstream.stream.Source
All Known Implementing Classes:
Balaban10CageGraphGenerator, Balaban11CageGraphGenerator, BananaTreeGenerator, BarabasiAlbertGenerator, BaseGenerator, BidiakisCubeGenerator, BiggsSmithGraphGenerator, ChvatalGenerator, CubicalGraphGenerator, DesarguesGraphGenerator, DodecahedralGraphGenerator, DorogovtsevMendesGenerator, DyckGraphGenerator, F26AGraphGenerator, FlowerSnarkGenerator, FosterGraphGenerator, FranklinGraphGenerator, FruchtGraphGenerator, FullGenerator, GrayGraphGenerator, GridGenerator, HarriesGraphGenerator, HarriesWongGraphGenerator, HeawoodGraphGenerator, IncompleteGridGenerator, LCFGenerator, LifeGenerator, LjubljanaGraphGenerator, LobsterGenerator, McGeeGraphGenerator, MobiusKantorGraphGenerator, NauruGraphGenerator, PappusGraphGenerator, PetersenGraphGenerator, PointsOfInterestGenerator, PreferentialAttachmentGenerator, RandomEuclideanGenerator, RandomFixedDegreeDynamicGraphGenerator, RandomGenerator, TetrahedralGraphGenerator, TruncatedCubicalGraphGenerator, TruncatedDodecahedralGraphGenerator, TruncatedOctahedralGraphGenerator, TruncatedTetrahedralGraphGenerator, Tutte12CageGraphGenerator, TutteCoxeterGraphGenerator, URLGenerator, UtilityGraphGenerator, WagnerGraphGenerator, WattsStrogatzGenerator, WikipediaGenerator

public interface Generator
extends org.graphstream.stream.Source

Graph generator.

A graph generator is an object that can send graph events to create a new graph from an internal description. Some generators will create a static predefined graph, others will be able to continuously evolve Indeed some generators define an end to the generation process, others may continue endlessly.

Each generator, in addition of being a source of events, provide only three methods:


Method Summary
 void begin()
          Begin the graph generation.
 void end()
          End the graph generation by finalizing it.
 boolean nextEvents()
          Perform the next step in generating the graph.
 
Methods inherited from interface org.graphstream.stream.Source
addAttributeSink, addElementSink, addSink, clearAttributeSinks, clearElementSinks, clearSinks, removeAttributeSink, removeElementSink, removeSink
 

Method Detail

begin

void begin()
Begin the graph generation. This usually is the place for initialization of the generator. After calling this method, call the nextEvents() method to add elements to the graph.


nextEvents

boolean nextEvents()
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.

end

void end()
End the graph generation by finalizing it. Once the nextEvents() method returned false (or even if you stop before), this method must be called to finish the graph.



Copyright © 2013. All Rights Reserved.