Class PointsOfInterestGenerator
java.lang.Object
org.graphstream.stream.SourceBase
org.graphstream.algorithm.generator.BaseGenerator
org.graphstream.algorithm.generator.PointsOfInterestGenerator
- All Implemented Interfaces:
Generator
,org.graphstream.stream.Source
public class PointsOfInterestGenerator extends BaseGenerator
Generate a social dynamic graph. Graph is composed of high-connected
group of nodes, modeling organizations, and few connections between
organizations.
This is done by creating points of interest. Nodes can be interested
by these points or loose them interest. When two nodes are interested by at
least one common point, then there are connected.
Some probabilities can be set defining the following events :
- remove a node ;
- add a node ;
- remove a point of interest ;
- add a point of interest.
- initial count of points of interest ;
- initial count of nodes ;
- Author:
- Guilhelm Savin
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PointsOfInterestGenerator.Parameter
-
Constructor Summary
Constructors Constructor Description PointsOfInterestGenerator()
-
Method Summary
Modifier and Type Method Description void
begin()
Add initial count of points of interest, and initial count of people.void
end()
End the graph generation by finalizing it.static void
main(String... args)
boolean
nextEvents()
Step of the generator.void
setParameter(PointsOfInterestGenerator.Parameter p, Object value)
Methods inherited from class org.graphstream.algorithm.generator.BaseGenerator
addEdgeAttribute, addEdgeAttribute, addEdgeAttribute, addEdgeLabels, addNodeAttribute, addNodeAttribute, addNodeAttribute, addNodeLabels, 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
-
PointsOfInterestGenerator
public PointsOfInterestGenerator()
-
-
Method Details
-
setParameter
-
begin
public void begin()Add initial count of points of interest, and initial count of people.- See Also:
Generator.begin()
-
nextEvents
public boolean nextEvents()Step of the generator. Try to remove a node according to thedelPeopleProbability
. Try to add a node according to theaddPeopleProbability
. Try to remove a point of interest according to thedelPointOfInterestProbability
. Try to add a point of interest according to theaddPointOfInterestProbability
. Then, step of addicts.- Returns:
- true while there are elements to add to the graph.
- See Also:
PointsOfInterestGenerator.Addict.step()
,Generator.nextEvents()
-
end
public void end()Description copied from class:BaseGenerator
End the graph generation by finalizing it. Once theGenerator.nextEvents()
method returned false (or even if you stop before), this method must be called to finish the graph. In addition, BaseGenerator adds a "clear" operations that removes all the kept edges and nodes identifiers and the associated data.- Specified by:
end
in interfaceGenerator
- Overrides:
end
in classBaseGenerator
-
main
-