Interface Generator
- All Superinterfaces:
org.graphstream.stream.Source
- All Known Implementing Classes:
Balaban10CageGraphGenerator
,Balaban11CageGraphGenerator
,BananaTreeGenerator
,BarabasiAlbertGenerator
,BaseGenerator
,BidiakisCubeGenerator
,BiggsSmithGraphGenerator
,ChainGenerator
,ChvatalGenerator
,CubicalGraphGenerator
,DesarguesGraphGenerator
,DodecahedralGraphGenerator
,DorogovtsevMendesGenerator
,DyckGraphGenerator
,F26AGraphGenerator
,FlowerSnarkGenerator
,FosterGraphGenerator
,FranklinGraphGenerator
,FruchtGraphGenerator
,FullGenerator
,GrayGraphGenerator
,GridGenerator
,HarriesGraphGenerator
,HarriesWongGraphGenerator
,HeawoodGraphGenerator
,HypercubeGenerator
,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:
- One to start the generation process
begin()
. For static generators this often generate a whole graph, for dynamic generators this only initialise a base graph. - One to generate more dynamic events
nextEvents()
. This method will, as its name suggests, generate more dynamic events making the graph evolve. You can call it (repeatedly) only between a call tobegin()
and toend()
. This method returns a boolean that may indicate that no more events can be generated. - One to end the generation process
end()
. This method must ALWAYS be called when finished with the generator.
-
Method Summary
Modifier and Type Method Description 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.
-
Method Details
-
begin
void begin()Begin the graph generation. This usually is the place for initialization of the generator. After calling this method, call thenextEvents()
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 thenextEvents()
method returned false (or even if you stop before), this method must be called to finish the graph.
-