public class RandomFixedDegreeDynamicGraphGenerator extends BaseGenerator
A graph consists in a set of vertices and a set of edges. The dynamic relies on 4 kinds of steps of events: at each step:
This generator is characterized by:
How to build such graphs ? There exist at least one mathematical function for doing that f(step) = nbVertices*log(step)/log(step+"Pente") the larger "Pente", the softer the "pente" of the curve. Given f(step), it is possible to compute nbCreations and nbDeletions together with the graph nervosity. f(step) represents the number of vertices that should be present within the graph given the step and the value of the parameter "Pente". However, as our graph is dynamic, some vertices may be deleted while some other vertices may be added to the graph. Question: could it be possible to build a dynamic graph that reaches a stable state (stabilization of the number of vertices, and stabilization of some other properties), just by adding some constraints/characteristics on each node?
SourceBase.ElementType
Modifier and Type | Field and Description |
---|---|
protected int |
currentNodeId
Used to generate node ids.
|
protected int |
deltaStep
Influence the number of nodes created at each step.
|
protected double |
meanDegreeLimit
Limit for the mean degree of nodes.
|
protected int |
nbVertices
Average number of vertices.
|
protected double |
nervousness
Nervousness of the generator.
|
protected int |
step
Current step of the generator.
|
addEdgeLabels, addNodeLabels, directed, edgeAttributeRange, edgeAttributes, internalGraph, nodeAttributeRange, nodeAttributes, random, randomlyDirected
attrSinks, eltsSinks, eventProcessing, eventQueue, sourceId, sourceTime
Constructor and Description |
---|
RandomFixedDegreeDynamicGraphGenerator()
Create a new RandomFixedDegreeDynamicGraphGenerator generator with
default values for attributes.
|
RandomFixedDegreeDynamicGraphGenerator(int nbVertices,
double meanDegreeLimit,
double nervousness)
Create a new RandomFixedDegreeDynamicGraphGenerator generator.
|
Modifier and Type | Method and Description |
---|---|
void |
begin()
Begin the graph generation.
|
void |
end()
End the graph generation by finalizing it.
|
protected String |
getEdgeId(String src,
String trg) |
double |
meanDegree()
This method computes the mean degree of the graph.
|
boolean |
nextEvents()
Step of the generator.
|
addEdge, addEdgeAttribute, addEdgeLabels, addNode, addNode, addNodeAttribute, addNodeLabels, clearKeptData, delEdge, delNode, isUsingInternalGraph, removeEdgeAttribute, removeNodeAttribute, setDirectedEdges, setEdgeAttributesRange, setNodeAttributesRange, setRandomSeed, setUseInternalGraph
addAttributeSink, addElementSink, addSink, attributeSinks, clearAttributeSinks, clearElementSinks, clearSinks, elementSinks, manageEvents, 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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addAttributeSink, addElementSink, addSink, clearAttributeSinks, clearElementSinks, clearSinks, removeAttributeSink, removeElementSink, removeSink
protected int nbVertices
protected double meanDegreeLimit
protected double nervousness
protected int step
protected int deltaStep
protected int currentNodeId
public RandomFixedDegreeDynamicGraphGenerator()
public RandomFixedDegreeDynamicGraphGenerator(int nbVertices, double meanDegreeLimit, double nervousness)
nbVertices
- The number of vertices.meanDegreeLimit
- The average degree.nervousness
- The nervousness.public double meanDegree()
public void begin()
Generator
Generator.nextEvents()
method to add elements to the graph.public boolean nextEvents()
Generator.nextEvents()
public void end()
BaseGenerator
Generator.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.end
in interface Generator
end
in class BaseGenerator
WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses