Class StressMinimizationImplementation
java.lang.Object
org.vanted.plugins.layout.stressminimization.StressMinimizationImplementation
public class StressMinimizationImplementation extends Object
-
Constructor Summary
Constructors Constructor Description StressMinimizationImplementation(IndexedNodeSet nodes, StressMinimizationLayout callingLayout, boolean useLandmarks, int numberOfLandmarks, int alpha, double stressChangeEpsilon, double initialStressPercentage, double minimumNodeMovementThreshold, double iterationsThreshold, int edgeScalingFactor)
Creates a new StressMinimizationImplementation working on the given list of nodes and using callingLayout for pausing and stopping behavior -
Method Summary
Modifier and Type Method Description org.apache.commons.math3.linear.RealVector
calcDistances(int fromIndex)
Calculates the distance vector from the node at the specified index to all other nodes.org.apache.commons.math3.linear.RealMatrix
calcPairwiseDistances(IndexedNodeSet nodes)
Calculates the distance matrix of the given nodes set.void
calculateLayout()
Calculates an optimized layout for this instances nodes.Supplier<HashMap<Node,Vector2d>>
getLayoutSupplier()
-
Constructor Details
-
StressMinimizationImplementation
public StressMinimizationImplementation(IndexedNodeSet nodes, StressMinimizationLayout callingLayout, boolean useLandmarks, int numberOfLandmarks, int alpha, double stressChangeEpsilon, double initialStressPercentage, double minimumNodeMovementThreshold, double iterationsThreshold, int edgeScalingFactor)Creates a new StressMinimizationImplementation working on the given list of nodes and using callingLayout for pausing and stopping behavior- Parameters:
nodes
- The nodes to layout.callingLayout
- The StressMinimizationLayout instance creating this instancenumberOfLandmarks
-alpha
- alpha exponent for weighting.stressChangeEpsilon
- Stress change threshold below which execution will be terminatedinitialStressPercentage
- The initial stress percentage below which execution will be terminatedminimumNodeMovementThreshold
- The minimum node movement threshold below which execution will be terminatediterationsThreshold
- The maximal number of iterations above which execution will be terminated
-
-
Method Details
-
calculateLayout
public void calculateLayout()Calculates an optimized layout for this instances nodes. -
calcPairwiseDistances
Calculates the distance matrix of the given nodes set.- Parameters:
nodes
- A list of nodes. For these nodes the distances to the other nodes in the set will be calculated.- Returns:
- the distance matrix
-
calcDistances
public org.apache.commons.math3.linear.RealVector calcDistances(int fromIndex)Calculates the distance vector from the node at the specified index to all other nodes.- Parameters:
fromIndex
- the distances from this node to all others will be calculated.- Returns:
- the distance vector from the from node to all others
-
getLayoutSupplier
-