public abstract class VOSLayoutAlgorithm extends java.lang.Object implements java.lang.Cloneable, QualityLayoutAlgorithm
Modifier and Type | Field and Description |
---|---|
protected int |
attraction
Attraction parameter.
|
static int |
DEFAULT_ATTRACTION
Default attraction parameter.
|
static double |
DEFAULT_EDGE_WEIGHT_INCREMENT
Default edge weight increment parameter.
|
static int |
DEFAULT_REPULSION
Default repulsion parameter.
|
protected double |
edgeWeightIncrement
Edge weight increment parameter.
|
protected int |
repulsion
Repulsion parameter.
|
Constructor and Description |
---|
VOSLayoutAlgorithm()
Constructs a VOS layout algorithm.
|
VOSLayoutAlgorithm(int attraction,
int repulsion,
double edgeWeightIncrement)
Constructs a VOS layout algorithm with a specified attraction parameter,
repulsion parameter, and edge weight increment parameter.
|
Modifier and Type | Method and Description |
---|---|
double |
calcQuality(Network network,
Layout layout)
Calculates the quality of a layout using the VOS quality function.
|
VOSLayoutAlgorithm |
clone()
Clones the algorithm.
|
int |
getAttraction()
Returns the attraction parameter.
|
double |
getEdgeWeightIncrement()
Returns the edge weight increment parameter.
|
int |
getRepulsion()
Returns the repulsion parameter.
|
void |
setAttraction(int attraction)
Sets the attraction parameter.
|
void |
setEdgeWeightIncrement(double edgeWeightIncrement)
Sets the edge weight increment parameter.
|
void |
setRepulsion(int repulsion)
Sets the repulsion parameter.
|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
findLayout
public static final int DEFAULT_ATTRACTION
public static final int DEFAULT_REPULSION
public static final double DEFAULT_EDGE_WEIGHT_INCREMENT
protected int attraction
protected int repulsion
protected double edgeWeightIncrement
public VOSLayoutAlgorithm()
public VOSLayoutAlgorithm(int attraction, int repulsion, double edgeWeightIncrement)
attraction
- Attraction parameterrepulsion
- Repulsion parameteredgeWeightIncrement
- Edge weight increment parameterpublic VOSLayoutAlgorithm clone()
clone
in class java.lang.Object
public int getAttraction()
public int getRepulsion()
public double getEdgeWeightIncrement()
public void setAttraction(int attraction)
attraction
- Attraction parameterpublic void setRepulsion(int repulsion)
repulsion
- Repulsion parameterpublic void setEdgeWeightIncrement(double edgeWeightIncrement)
edgeWeightIncrement
- Edge weight increment parameterpublic double calcQuality(Network network, Layout layout)
The VOS quality function is given by
1 / attraction * sum(a[i][j] * d(x[i], x[j]) ^
attraction) - 1 / repulsion * sum(d(x[i], x[j]) ^
repulsion)
,
where a[i][j]
is the weight of the edge between nodes i
and j
and x[i] = (x[i][1], x[i][2])
are the coordinates
of node i
. The function d(x[i], x[j])
is the Euclidean
distance between nodes i
and j
. The sum is taken over all
pairs of nodes i
and j
with j < i
. The attraction
parameter must be greater than the repulsion parameter. The lower the
value of the VOS quality function, the higher the quality of the layout.
calcQuality
in interface QualityLayoutAlgorithm
network
- Networklayout
- Layout