public class FR91Layout
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
double |
area
area of the drawing region (width times height)
|
double |
C
step: by default step=1, in the original algorithm FR91
|
protected double |
coolingConstant
cooling constant: temperature decreases (e.g.
|
private int |
countRepulsive |
AdjacencyListGraph |
g
Input graph to draw
|
double |
h
dimensions of the drawing region
|
int |
iterationCount |
double |
k
strength of the spring ("optimal distance")
|
static int |
maxIterations
maximum number of iterations to perform
|
protected double |
minTemperature
minimal temperature (strictly positive)
|
Jcg.geometry.Point_2[] |
points
3D positions of the vertices of the graph defining the planar layout.
|
protected double |
temperature
initial temperature
|
protected boolean |
useCooling
decide whether to make use of simulated annealing
|
double |
w
dimensions of the drawing region
|
Constructor and Description |
---|
FR91Layout(AdjacencyListGraph g,
double w,
double h)
Initialize the parameters of the force-directed method, according to the original FR91 algorithm
|
Modifier and Type | Method and Description |
---|---|
double |
attractiveForce(double distance)
Compute the (intensity of the) attractive force between two nodes at a given distance
|
Jcg.geometry.Vector_2[] |
computeAllAttractiveForces()
Compute attractive forces for all vertices (between neighboring vertices)
|
Jcg.geometry.Vector_2[] |
computeAllRepulsiveForces()
Compute repulsive forces for all vertices (between all vertices)
|
Jcg.geometry.Vector_2 |
computeAttractiveForce(Node u) |
Jcg.geometry.Vector_2 |
computeRepulsiveForce(Node u) |
protected void |
cooling()
Cooling system: the temperature decreases at each iteration of a multiplicative factor
Remark: the temperature is assumed to remain strictly positive (>=minTemperature)
|
void |
disableCooling()
Disable cooling process
|
void |
enableCooling()
Enable cooling process
|
void |
oneIteration()
Perform one iteration of the Force-Directed algorithm.
|
double |
repulsiveForce(double distance)
Compute the (intensity of the) repulsive force between two nodes at a given distance
|
void |
repulsiveForce(Node u,
Jcg.geometry.Vector_2[] disp) |
Jcg.geometry.Vector_2 |
slowRepulsiveForce(Node u) |
java.lang.String |
toString() |
public AdjacencyListGraph g
public Jcg.geometry.Point_2[] points
public static int maxIterations
public double k
public double C
public double w
public double h
public double area
protected double temperature
protected double minTemperature
protected double coolingConstant
protected boolean useCooling
public int iterationCount
private int countRepulsive
public FR91Layout(AdjacencyListGraph g, double w, double h)
g
- the input graph to draww
- width of the drawing areah
- height of the drawing areapublic void enableCooling()
public void disableCooling()
public double attractiveForce(double distance)
distance
- distance between two nodespublic double repulsiveForce(double distance)
distance
- distance between two nodespublic void oneIteration()
public Jcg.geometry.Vector_2 slowRepulsiveForce(Node u)
public Jcg.geometry.Vector_2 computeRepulsiveForce(Node u)
public void repulsiveForce(Node u, Jcg.geometry.Vector_2[] disp)
public Jcg.geometry.Vector_2 computeAttractiveForce(Node u)
public Jcg.geometry.Vector_2[] computeAllRepulsiveForces()
public Jcg.geometry.Vector_2[] computeAllAttractiveForces()
protected void cooling()
public java.lang.String toString()
toString
in class java.lang.Object