|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectccvisu.Minimizer
ccvisu.MinimizerBarnesHut
public class MinimizerBarnesHut
Minimizer for the (weighted) (edge-repulsion) LinLog energy model, based on the Barnes-Hut algorithm.
| Nested Class Summary | |
|---|---|
private class |
MinimizerBarnesHut.OctTree
Octtree for graph nodes with positions in 3D space. |
| Field Summary | |
|---|---|
private float |
attrExponent
Exponent of the Euclidean distance in the attraction term of the energy model. |
private int[][] |
attrIndexes
Node indexes of the similarity list for each node. |
private float[][] |
attrValues
Similarity values of the similarity lists for each node. |
private Position |
baryCenter
Position of the barycenter of the nodes. |
private GraphData |
graph
The graph that this layout is computed for. |
private float |
gravitationFactor
Factor for the gravitation energy (attraction to the barycenter), 0.0f for no gravitation. |
private int |
nodeNr
Number of nodes. |
private MinimizerBarnesHut.OctTree |
octTree
Octtree for repulsion computation. |
private Options |
options
Options for the minimizer. |
private float[] |
repu
Repulsion vector (node weights). |
private float |
repuExponent
Exponent of the Euclidean distance in the repulsion term of the energy model. |
private float |
repuFactor
Factor for repulsion energy that normalizes average distance between pairs of nodes with maximum similarity to (roughly) 1. |
private static float[] |
repuStrategy
Factors for the repulsion force for pulsing. |
| Fields inherited from class ccvisu.Minimizer |
|---|
listeners |
| Constructor Summary | |
|---|---|
MinimizerBarnesHut(Options pOpt)
Sets the number of nodes, the similarity matrices (edge weights), and the position matrix. |
|
| Method Summary | |
|---|---|
private float |
addRepulsionDir(int index,
MinimizerBarnesHut.OctTree tree,
Position dir)
Computes the direction of the repulsion force from the tree on the specified node. |
private void |
analyzeDistances()
Computes and outputs some statistics. |
private void |
buildOctTree()
Builds the octtree. |
private void |
computeBaryCenter()
Computes the position of the barycenter baryCenter
of all nodes. |
private float |
computeRepuFactor()
Computes the factor for repulsion forces repuFactor
such that in the energy minimum the average Euclidean distance
between pairs of nodes with similarity 1.0 is approximately 1. |
private void |
getDirection(int index,
Position dir)
Computes the direction of the total force acting on the specified node. |
private float |
getDist(Position pos1,
Position pos2)
Returns the Euclidean distance between the specified positions. |
private float |
getEnergy(int index)
Returns the energy of the specified node. |
private float |
getRepulsionEnergy(int index,
MinimizerBarnesHut.OctTree tree)
Returns the repulsion energy between the node with the specified index and the nodes in the octtree. |
void |
minimizeEnergy()
Iteratively minimizes energy using the Barnes-Hut algorithm. |
| Methods inherited from class ccvisu.Minimizer |
|---|
addGraphEventListener |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private final Options options
private final int nodeNr
private final GraphData graph
minimizeEnergy.
If the input is two-dimensional (i.e. pos[i][2] == 0
for all i), the output is also two-dimensional.
Random initial positions are appropriate.
Preconditions: dimension at least [nodeNr][3];
no two different nodes have the same position
The input positions should be scaled such that
the average Euclidean distance between connected nodes
is roughly 1.
private final int[][] attrIndexes
private final float[][] attrValues
private final float[] repu
private float attrExponent
private float repuExponent
private Position baryCenter
private float gravitationFactor
private float repuFactor
private static final float[] repuStrategy
private MinimizerBarnesHut.OctTree octTree
| Constructor Detail |
|---|
public MinimizerBarnesHut(Options pOpt)
| Method Detail |
|---|
public void minimizeEnergy()
pos,
and stores the computed positions in pos.
minimizeEnergy in class Minimizer
private float getDist(Position pos1,
Position pos2)
private float getRepulsionEnergy(int index,
MinimizerBarnesHut.OctTree tree)
index - Index of the repulsing node.tree - Octtree containing repulsing nodes.
private float getEnergy(int index)
index - Index of a node.
private float addRepulsionDir(int index,
MinimizerBarnesHut.OctTree tree,
Position dir)
index - Index of the repulsed node.tree - Repulsing octtree.dir - Direction of the repulsion force acting on the node
is added to this variable (output parameter).
private void getDirection(int index,
Position dir)
index - Index of a node.dir - Direction of the total force acting on the node
(output parameter).private void buildOctTree()
private float computeRepuFactor()
repuFactor
such that in the energy minimum the average Euclidean distance
between pairs of nodes with similarity 1.0 is approximately 1.
private void computeBaryCenter()
baryCenter
of all nodes.
private void analyzeDistances()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||