public class SpringBox extends BarnesHutLayout
This layout is the default GraphStream layout that handles dynamic graphs.
It can constantly evolve according to the changes in the graph. And works
well with the LayoutRunner
class so that the computations stops
when the layout is stable enougth.
This algorithm is based on the Frutcherman-Reingold force layout algorithm modified on the attraction (the degree of nodes is taken into account to stabilize the layout as we are not only interested in the result, but also in the steps in between).
SourceBase.ElementType
Modifier and Type | Field and Description |
---|---|
protected double |
k
The optimal distance between nodes.
|
protected double |
K1
Default attraction.
|
protected double |
K2
Default repulsion.
|
area, avgLength, center, edges, energies, force, gravity, hi, is3D, lastElementCount, lastStepTime, lo, maxMoveLength, nodeMoveCount, nodes, nodesPerCell, outputNodeStats, outputStats, quality, random, sendMoveEventsEvery, sendNodeInfos, sinkTime, stabilizationLimit, statsOut, theta, time, viewZone
attrSinks, eltsSinks, eventProcessing, eventQueue, sourceId, sourceTime
Constructor and Description |
---|
SpringBox()
New "Spring-Box" 2D Barnes-Hut simulation.
|
SpringBox(boolean is3D)
New "Spring-Box" Barnes-Hut simulation.
|
SpringBox(boolean is3D,
Random randomNumberGenerator)
New "Spring-Box" Barnes-Hut simulation.
|
Modifier and Type | Method and Description |
---|---|
protected void |
chooseNodePosition(NodeParticle n0,
NodeParticle n1)
Choose the best position for a node that was just connected by only one
edge to a cluster of nodes.
|
String |
getLayoutAlgorithmName()
Name of the layout algorithm.
|
NodeParticle |
newNodeParticle(String id)
Factory method to create node particles.
|
void |
setQuality(double qualityLevel)
Set the overall quality level, a number between 0 and 1 with 1 the
highest quality available, but often with a slower computation.
|
addEdge, addEdgeBreakPoint, addNode, clear, compute, computeArea, edgeAdded, edgeAttributeAdded, edgeAttributeChanged_, edgeAttributeChanged, edgeAttributeRemoved, edgeRemoved, freezeNode, getBarnesHutTheta, getCenterPoint, getEnergies, getForce, getGravityFactor, getHiPoint, getLastStepTime, getLowPoint, getNodeMovedCount, getQuality, getRandom, getSpatialIndex, getStabilization, getStabilizationLimit, getSteps, getViewZone, graphAttributeAdded, graphAttributeChanged_, graphAttributeChanged, graphAttributeRemoved, graphCleared, ignoreEdge, is3D, moveNode, nodeAdded, nodeAttributeAdded, nodeAttributeChanged_, nodeAttributeChanged, nodeAttributeRemoved, nodeRemoved, particleAdded, particleAdded, particleAttributeChanged, particleMarked, particleMoved, particleRemoved, printStats, randomXInsideBounds, randomYInsideBounds, randomZInsideBounds, removeEdge, removeNode, setBarnesHutTheta, setEdgeWeight, setForce, setGravityFactor, setNodeWeight, setSendNodeInfos, setStabilizationLimit, shake, stepBegins, stepFinished
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 double k
protected double K1
protected double K2
public SpringBox()
public SpringBox(boolean is3D)
is3D
- If true the simulation dimensions count is 3 else 2.public String getLayoutAlgorithmName()
Layout
getLayoutAlgorithmName
in interface Layout
getLayoutAlgorithmName
in class BarnesHutLayout
public void setQuality(double qualityLevel)
Layout
setQuality
in interface Layout
setQuality
in class BarnesHutLayout
qualityLevel
- The quality level, a number between 0 and 1.protected void chooseNodePosition(NodeParticle n0, NodeParticle n1)
BarnesHutLayout
chooseNodePosition
in class BarnesHutLayout
n0
- source node of the edge.n1
- target node of the edge.public NodeParticle newNodeParticle(String id)
BarnesHutLayout
newNodeParticle
in class BarnesHutLayout
id
- The identifier of the new node/particle.WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses