
Search this API  
PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: NESTED  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 
java.lang.Object y.layout.router.polyline.PenaltySettings
public class PenaltySettings
This class provides the cost penalties that are applied for violating restrictions during a PathSearch
.
The PathSearch
calculates the shortest path from the source to the target, where shortest path means the
path with the lowest costs. Costs result from violations of restrictions that are defined by the different PathSearchExtension
s. This class defines penalties for the various violations. The PathSearch
can be
adapted to specific needs by varying these penalties. In order to avoid a certain violation, the appropriate penalty
must be increased.
There are some predefined penalty settings which set a different focus for the path search:
OPTIMIZATION_BALANCED
, OPTIMIZATION_EDGE_BENDS
, OPTIMIZATION_EDGE_LENGTHS
and
OPTIMIZATION_EDGE_CROSSINGS
.
PathSearch
together. Therefore,
changing a certain penalty might not always lead to the desired effect for specific edges.Double.MAX_VALUE
as they easily lead to overflows and routing artifacts.Field Summary  

static PenaltySettings 
OPTIMIZATION_BALANCED
Optimization strategy that balances bends and edge crossings in the edge routes. 
static PenaltySettings 
OPTIMIZATION_EDGE_BENDS
Optimization strategy that minimizes bends in the edge routes. 
static PenaltySettings 
OPTIMIZATION_EDGE_CROSSINGS
Optimization strategy that minimizes edge crossings in the edge routes. 
static PenaltySettings 
OPTIMIZATION_EDGE_LENGTHS
Optimization strategy that minimizes the length of the edge routes. 
Constructor Summary  

protected 
PenaltySettings()
Creates a new instance of PenaltySettings . 
Method Summary  

PenaltySettings 
createCopy()
Creates a copy of this PenaltySettings instance. 
double 
getAdjacentEdgeCrossingPenalty()
Returns the penalty for a crossing of two edges that are adjacent, that is, share a common node. 
double 
getBendPenalty()
Returns the penalty for an edge bend. 
double 
getBendsInNodeToEdgeDistancePenalty()
Returns the penalty for an edge bend being closer to the border of the source node, the target node or one of their ancestor group nodes than the minimum node to edge distance. 
double 
getEdgeCrossingPenalty()
Returns the penalty for a crossing of two edges. 
double 
getEdgeLabelCrossingPenalty()
Returns the penalty for an edge crossing an edge label. 
double 
getEdgeLengthPenalty()
Returns the penalty for the edge length. 
double 
getGroupNodeCrossingPenalty()
Returns the penalty for an edge crossing a group node. 
double 
getInvalidEdgeGroupingPenalty()
Returns the penalty for an edge with a group ID that is not grouped at source or target side. 
double 
getMinimalEdgeToEdgeDistancePenalty()
Returns the penalty for violations of the minimum distance between any two edges. 
double 
getMinimalFirstLastSegmentLengthPenalty()
Returns the penalty for violations of the minimum length of the first and last segment of an edge. 
double 
getMinimalGroupNodeToEdgeDistancePenalty()
Returns the penalty for violations of the minimum distance between any edge and any group node side. 
double 
getMinimalNodeCornerDistancePenalty()
Returns the penalty for violations of the minimum distance the edge shall maintain from node corners when entering or leaving the node. 
double 
getMinimalNodeToEdgeDistancePenalty()
Returns the penalty for violations of the minimum distance between any edge and any normal node side. 
double 
getMonotonyViolationPenalty()
Returns the penalty for violating the monotonic path restrictions of an edge. 
double 
getNodeCrossingPenalty()
Returns the penalty for an edge crossing a regular node. 
double 
getNodeLabelCrossingPenalty()
Returns the penalty for an edge crossing a node label. 
double 
getPartitionGridCellReentrancePenalty()
Returns the penalty for an edge leaving and reentering in the same partition grid cell. 
double 
getPortViolationPenalty()
Returns the penalty if an edge does not comply with its PortCandidate s or PortConstraint s. 
double 
getSelfCrossingPenalty()
Returns the penalty for a crossing of two segments that belong the same edge. 
double 
getSingleSideSelfLoopPenalty()
Returns the penalty for bends of a selfloop edge. 
double 
getSketchViolationPenalty()
Returns the penalty for deviating from the original edge path if the routing policy is set to
EdgeLayoutDescriptor.ROUTING_POLICY_SEGMENTS_AS_NEEDED . 
protected PenaltySettings 
newInstance()
Creates a new instance of PenaltySettings . 
void 
setAdjacentEdgeCrossingPenalty(double penalty)
Specifies the penalty for a crossing of two edges that are adjacent, that is, share a common node. 
void 
setBendPenalty(double penalty)
Specifies the penalty for an edge bend. 
void 
setBendsInNodeToEdgeDistancePenalty(double penalty)
Specifies the penalty for an edge bend being closer to the border of the source node, the target node or one of their ancestor group nodes than the minimum node to edge distance. 
void 
setEdgeCrossingPenalty(double penalty)
Specifies the penalty for a crossing of two edges. 
void 
setEdgeLabelCrossingPenalty(double penalty)
Specifies the penalty for an edge crossing an edge label. 
void 
setEdgeLengthPenalty(double penalty)
Sets the penalty for the edge length. 
void 
setGroupNodeCrossingPenalty(double penalty)
Specifies the penalty for an edge crossing a group node. 
void 
setInvalidEdgeGroupingPenalty(double penalty)
Specifies the penalty for an edge with a group ID that is not grouped at source or target side. 
void 
setMinimalEdgeToEdgeDistancePenalty(double penalty)
Specifies the penalty for violations of the minimum distance between any two edges. 
void 
setMinimalFirstLastSegmentLengthPenalty(double penalty)
Specifies the penalty for violations of the minimum length of the first and last segment of an edge. 
void 
setMinimalGroupNodeToEdgeDistancePenalty(double penalty)
Specifies the penalty for violations of the minimum distance between any edge and any group node side. 
void 
setMinimalNodeCornerDistancePenalty(double penalty)
Specifies the penalty for violations of the minimum distance the edge shall maintain from node corners when entering or leaving the node. 
void 
setMinimalNodeToEdgeDistancePenalty(double penalty)
Specifies the penalty for violations of the minimum distance between any edge and any nongroup node side. 
void 
setMonotonyViolationPenalty(double penalty)
Specifies the penalty for violating the monotonic path restrictions of an edge. 
void 
setNodeCrossingPenalty(double penalty)
Specifies the penalty for an edge crossing a regular node. 
void 
setNodeLabelCrossingPenalty(double penalty)
Specifies the penalty for an edge crossing a node label. 
void 
setPartitionGridCellReentrancePenalty(double penalty)
Specifies the penalty for an edge leaving and reentering in the same partition grid cell. 
void 
setPortViolationPenalty(double penalty)
Specifies the penalty if an edge does not comply with its PortCandidate s or PortConstraint s. 
void 
setSelfCrossingPenalty(double penalty)
Specifies the penalty for a crossing of two segments that belong the same edge. 
void 
setSingleSideSelfLoopPenalty(double penalty)
Sets the penalty for bends of a selfloop edge. 
void 
setSketchViolationPenalty(double penalty)
Specifies the penalty for deviating from the original edge path if the routing policy is set to
EdgeLayoutDescriptor.ROUTING_POLICY_SEGMENTS_AS_NEEDED . 
Methods inherited from class java.lang.Object 

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 
Field Detail 

public static final PenaltySettings OPTIMIZATION_BALANCED
public static final PenaltySettings OPTIMIZATION_EDGE_BENDS
public static final PenaltySettings OPTIMIZATION_EDGE_CROSSINGS
public static final PenaltySettings OPTIMIZATION_EDGE_LENGTHS
Constructor Detail 

protected PenaltySettings()
PenaltySettings
.
Method Detail 

public double getSketchViolationPenalty()
routing policy
is set to
EdgeLayoutDescriptor.ROUTING_POLICY_SEGMENTS_AS_NEEDED
. For other policies this value is ignored.
This penalty is mainly considered during a postprocessing step that tries to correct the current route. For larger penalty values, the algorithm may remove tiny nonorthogonal segments. In addition, larger values make it more likely that the algorithm considers a nonorthogonal segment to be either vertical/horizontal and tries to fix the route accordingly.
The value must be greater than or equal to 0
, otherwise the default value will be assigned.
setSketchViolationPenalty(double)
public void setSketchViolationPenalty(double penalty)
routing policy
is set to
EdgeLayoutDescriptor.ROUTING_POLICY_SEGMENTS_AS_NEEDED
. For other policies this value is ignored.
This penalty is mainly considered during a postprocessing step that tries to correct the current route. For larger penalty values, the algorithm may remove tiny nonorthogonal segments. In addition, larger values make it more likely that the algorithm considers a nonorthogonal segment to be either vertical/horizontal and tries to fix the route accordingly.
The value must be greater than or equal to 0
, otherwise the default value will be assigned.
penalty
 the penaltyEdgeLayoutDescriptor.ROUTING_POLICY_SEGMENTS_AS_NEEDED
public double getEdgeLengthPenalty()
Increasing the edge length penalty will raise the importance of short edges in relation to all other penalties while decreasing this penalty will raise the importance of all other restrictions. A high edge length penalty will result in routes that have less bends and more edge crossings to maintain the edge as short as possible.
The value must be greater than or equal to 0
, otherwise the default value will be assigned.
OPTIMIZATION_EDGE_LENGTHS
is a predefined configuration of PenaltySettings
where short
edges are preferred over a small amount of bends and edge crossings.Double.MAX_VALUE
as they easily lead to overflows and routing artifacts.setEdgeLengthPenalty(double)
public void setEdgeLengthPenalty(double penalty)
Increasing the edge length penalty will raise the importance of short edges in relation to all other penalties while decreasing this penalty will raise the importance of all other restrictions. A high edge length penalty will result in routes that have less bends and more edge crossings to maintain the edge as short as possible.
The value must be greater than or equal to 0
, otherwise the default value will be assigned.
OPTIMIZATION_EDGE_LENGTHS
is a predefined configuration of PenaltySettings
where short
edges are preferred over a small amount of bends and edge crossings.Double.MAX_VALUE
as they easily lead to overflows and routing artifacts.penalty
 the penaltypublic double getBendPenalty()
Increasing bend penalty will raise the importance of avoiding bends in relation to other penalties while decreasing this penalty will raise the importance of all other restrictions. A high bend penalty will result in routes that will preferably cross other edges instead of bending to avoid other edges. When increasing the edge bend penalty, the resulting routes will have more edge crossings.
The value must be greater than or equal to 0
, otherwise the default value will be assigned.
OPTIMIZATION_EDGE_BENDS
is a predefined configuration of PenaltySettings
where bends are
expensive and more edges will be crossed to avoid bending.1
) can lead to squiggles when the algorithm tries to avoid
more expensive restrictions.Double.MAX_VALUE
as they easily lead to overflows and routing artifacts.setBendPenalty(double)
public void setBendPenalty(double penalty)
Increasing bend penalty will raise the importance of avoiding bends in relation to other penalties while decreasing this penalty will raise the importance of all other restrictions. A high bend penalty will result in routes that will preferably cross other edges instead of bending to avoid other edges. When increasing the edge bend penalty, the resulting routes will have more edge crossings.
The value must be greater than or equal to 0
, otherwise the default value will be assigned.
OPTIMIZATION_EDGE_BENDS
is a predefined configuration of PenaltySettings
where bends are
expensive and more edges will be crossed to avoid bending.1
) can lead to squiggles when the algorithm tries to avoid
more expensive restrictions.Double.MAX_VALUE
as they easily lead to overflows and routing artifacts.penalty
 the penaltypublic double getEdgeCrossingPenalty()
getAdjacentEdgeCrossingPenalty()
and, by default, they are more expensive.
Increasing the edge crossing penalty will raise the importance of avoiding edge crossings in relation to other penalties, while decreasing this penalty will raise the importance of all other restrictions. When increasing the edge crossing penalty, the resulting route will be longer and have more bends because crossing other edges needs to be avoided.
The value must be greater than or equal to 0
, otherwise the default value will be assigned.
OPTIMIZATION_EDGE_CROSSINGS
is a predefined configuration of PenaltySettings
where edge
crossings are expensive and the routes get favourably longer with more bends to avoid crossing other edges.Double.MAX_VALUE
as they easily lead to overflows and routing artifacts.setEdgeCrossingPenalty(double)
,
setAdjacentEdgeCrossingPenalty(double)
public void setEdgeCrossingPenalty(double penalty)
getAdjacentEdgeCrossingPenalty()
and, by default, they are more expensive.
Increasing the edge crossing penalty will raise the importance of avoiding edge crossings in relation to other penalties, while decreasing this penalty will raise the importance of all other restrictions. When increasing the edge crossing penalty, the resulting route will be longer and have more bends because crossing other edges needs to be avoided.
The value must be greater than or equal to 0
, otherwise the default value will be assigned.
OPTIMIZATION_EDGE_CROSSINGS
is a predefined configuration of PenaltySettings
where edge
crossings are expensive and the routes get favourably longer with more bends to avoid crossing other edges.Double.MAX_VALUE
as they easily lead to overflows and routing artifacts.penalty
 the penaltysetAdjacentEdgeCrossingPenalty(double)
public double getAdjacentEdgeCrossingPenalty()
This penalty only induces costs for crossings between edges that have a common end point, i.e., where
one of the source/target nodes is equal. Crossings between nonadjacent edges are weighted using
getEdgeCrossingPenalty()
.
By default, avoiding crossing between adjacent edges is much more important and it is favored to introduce bends.
Crossings between unrelated edges less expensive and a crossing is preferred over an additional bend.
The value must be greater than or equal to 0
, otherwise the default value will be assigned.
OPTIMIZATION_EDGE_CROSSINGS
is a predefined configuration of PenaltySettings
where edge
crossings are expensive and the routes get favourably longer with more bends to avoid crossing other edges.setAdjacentEdgeCrossingPenalty(double)
,
setEdgeCrossingPenalty(double)
public void setAdjacentEdgeCrossingPenalty(double penalty)
This penalty only induces costs for crossings between edges that have a common end point, i.e., where
one of the source/target nodes is equal. Crossings between nonadjacent edges are weighted using
getEdgeCrossingPenalty()
.
By default, avoiding crossing between adjacent edges is much more important and it is favored to introduce bends.
Crossings between unrelated edges less expensive and a crossing is preferred over an additional bend.
The value must be greater than or equal to 0
, otherwise the default value will be assigned.
OPTIMIZATION_EDGE_CROSSINGS
is a predefined configuration of PenaltySettings
where edge
crossings are expensive and the routes get favourably longer with more bends to avoid crossing other edges.penalty
 the penaltysetEdgeCrossingPenalty(double)
public double getSelfCrossingPenalty()
This penalty only induces costs for crossings between edge segments that are part of the same actual edge.
Avoiding such selfcrossings is, by default, very important and associated with high costs. Therefore,
it is recommended to only reduce this for very specific cases. The costs of other crossings can be controlled
with properties setEdgeCrossingPenalty(double)
and setAdjacentEdgeCrossingPenalty(double)
.
The value must be greater than or equal to 0
, otherwise the default value will be assigned.
setSelfCrossingPenalty(double)
,
setEdgeCrossingPenalty(double)
,
setAdjacentEdgeCrossingPenalty(double)
public void setSelfCrossingPenalty(double penalty)
This penalty only induces costs for crossings between edge segments that are part of the same actual edge.
Avoiding such selfcrossings is, by default, very important and associated with high costs. Therefore,
it is recommended to only reduce this for very specific cases. The costs of other crossings can be controlled
with properties setEdgeCrossingPenalty(double)
and setAdjacentEdgeCrossingPenalty(double)
.
The value must be greater than or equal to 0
, otherwise the default value will be assigned.
penalty
 the penaltysetEdgeCrossingPenalty(double)
,
setAdjacentEdgeCrossingPenalty(double)
public double getNodeCrossingPenalty()
Increasing the node crossing penalty will raise the importance of avoiding node crossings in relation to other penalties, while decreasing this penalty will raise the importance of all other restrictions.
The value must be greater than or equal to 0
, otherwise the default value will be assigned.
Double.MAX_VALUE
as they easily lead to overflows and routing artifacts.setNodeCrossingPenalty(double)
public void setNodeCrossingPenalty(double penalty)
Increasing the node crossing penalty will raise the importance of avoiding node crossings in relation to other penalties, while decreasing this penalty will raise the importance of all other restrictions.
The value must be greater than or equal to 0
, otherwise the default value will be assigned.
Double.MAX_VALUE
as they easily lead to overflows and routing artifacts.penalty
 the penaltypublic double getGroupNodeCrossingPenalty()
Increasing the group node crossing penalty will raise the importance of avoiding group node crossings in relation to other penalties, while decreasing this penalty will raise the importance of all other restrictions.
node crossing penalty
, this penalty should be one of the highest
penalties to make sure that these nodes are avoided. However, as group nodes may be very large it might be
useful to allow group node crossings to achieve more direct edge routes.Double.MAX_VALUE
as they easily lead to overflows and routing artifacts.setGroupNodeCrossingPenalty(double)
public void setGroupNodeCrossingPenalty(double penalty)
Increasing the group node crossing penalty will raise the importance of avoiding group node crossings in relation to other penalties, while decreasing this penalty will raise the importance of all other restrictions.
node crossing penalty
, this penalty should be one of the highest
penalties to make sure that these nodes are avoided. However, as group nodes may be very large it might be
useful to allow group node crossings to achieve more direct edge routes.Double.MAX_VALUE
as they easily lead to overflows and routing artifacts.penalty
 the penaltypublic double getNodeLabelCrossingPenalty()
Increasing the node label crossing penalty will raise the importance of avoiding node labels crossings in relation to other penalties, while decreasing this penalty will raise the importance of all other restrictions. A high label crossing penalty will cause edges to bend more often to avoid passing straight through labels.
The crossing penalty can be weighted for each label individually using the
EdgeRouter.LABEL_CROSSING_COST_FACTOR_DPKEY
.
Use EdgeRouter.setConsiderNodeLabelsEnabled(boolean)
to set whether node labels should be considered when
routing the edges.
The value must be greater than or equal to 0
, otherwise the default value will be assigned.
node crossing penalty
is higher than the node label crossing penalty. Unless
the route connects from outside a group to one of its inner nodes, the node label will also be considered.Double.MAX_VALUE
as they easily lead to overflows and routing artifacts.setNodeLabelCrossingPenalty(double)
,
EdgeRouter.setConsiderNodeLabelsEnabled(boolean)
public void setNodeLabelCrossingPenalty(double penalty)
Increasing the node label crossing penalty will raise the importance of avoiding node labels crossings in relation to other penalties, while decreasing this penalty will raise the importance of all other restrictions. A high label crossing penalty will cause edges to bend more often to avoid passing straight through labels.
The crossing penalty can be weighted for each label individually using the
EdgeRouter.LABEL_CROSSING_COST_FACTOR_DPKEY
.
Use EdgeRouter.setConsiderNodeLabelsEnabled(boolean)
to set whether node labels should be considered when
routing the edges.
The value must be greater than or equal to 0
, otherwise the default value will be assigned.
node crossing penalty
is higher than the node label crossing penalty. Unless
the route connects from outside a group to one of its inner nodes, the node label will also be considered.Double.MAX_VALUE
as they easily lead to overflows and routing artifacts.penalty
 the penaltyEdgeRouter.setConsiderNodeLabelsEnabled(boolean)
public double getEdgeLabelCrossingPenalty()
Increasing the edge label crossing penalty will raise the importance of avoiding edge labels crossings in relation to other penalties, while decreasing this penalty will raise the importance of all other restrictions. A high label crossing penalty will cause edges to bend more often to avoid passing straight through labels.
The crossing penalty can be weighted for each label individually using the
EdgeRouter.LABEL_CROSSING_COST_FACTOR_DPKEY
.
Use EdgeRouter.setConsiderEdgeLabelsEnabled(boolean)
to set whether edge labels should be considered when
routing the edges.
The value must be greater than or equal to 0
, otherwise the default value will be assigned.
Double.MAX_VALUE
as they easily lead to overflows and routing artifacts.setEdgeLabelCrossingPenalty(double)
,
EdgeRouter.setConsiderEdgeLabelsEnabled(boolean)
public void setEdgeLabelCrossingPenalty(double penalty)
Increasing the edge label crossing penalty will raise the importance of avoiding edge labels crossings in relation to other penalties, while decreasing this penalty will raise the importance of all other restrictions. A high label crossing penalty will cause edges to bend more often to avoid passing straight through labels.
The crossing penalty can be weighted for each label individually using the
EdgeRouter.LABEL_CROSSING_COST_FACTOR_DPKEY
.
Use EdgeRouter.setConsiderEdgeLabelsEnabled(boolean)
to set whether edge labels should be considered when
routing the edges.
The value must be greater than or equal to 0
, otherwise the default value will be assigned.
Double.MAX_VALUE
as they easily lead to overflows and routing artifacts.penalty
 the penaltyEdgeRouter.setConsiderEdgeLabelsEnabled(boolean)
public double getMinimalNodeToEdgeDistancePenalty()
Increasing the minimum node to edge distance penalty will raise the importance of maintaining the minimum distance to nodes, while decreasing this penalty will raise the importance of all other restrictions. A high penalty for violating the minimum distance between edges and nodes will produce edges that rather use a long route around nodes to maintain the specified distance than pass through a small channel between two nodes.
The value must be greater than or equal to 0
, otherwise the default value will be assigned.
Double.MAX_VALUE
as they easily lead to overflows and routing artifacts.setMinimalNodeToEdgeDistancePenalty(double)
,
EdgeRouter.setMinimalNodeToEdgeDistance(double)
public void setMinimalNodeToEdgeDistancePenalty(double penalty)
Increasing the minimum node to edge distance penalty will raise the importance of maintaining the minimum distance to nodes, while decreasing this penalty will raise the importance of all other restrictions. A high penalty for violating the minimum distance between edges and nodes will produce edges that rather use a long route around nodes to maintain the specified distance than pass through a small channel between two nodes.
The value must be greater than or equal to 0
, otherwise the default value will be assigned.
Double.MAX_VALUE
as they easily lead to overflows and routing artifacts.penalty
 the penaltyEdgeRouter.setMinimalNodeToEdgeDistance(double)
public double getMinimalGroupNodeToEdgeDistancePenalty()
Increasing the minimum group node to edge distance penalty will raise the importance of maintaining the minimum distance to group nodes, while decreasing this penalty will raise the importance of all other restrictions. A high penalty for violating the minimum distance between edges and group nodes will produce edges that rather use a long route around group nodes to maintain the specified distance than pass through a small channel between two group nodes.
Use EdgeRouter.setMinimalNodeToEdgeDistance(double)
to set the minimum distance.
The value must be greater than or equal to 0
, otherwise the default value will be assigned.
Double.MAX_VALUE
as they easily lead to overflows and routing artifacts.setMinimalGroupNodeToEdgeDistancePenalty(double)
,
EdgeRouter.setMinimalNodeToEdgeDistance(double)
public void setMinimalGroupNodeToEdgeDistancePenalty(double penalty)
Increasing the minimum group node to edge distance penalty will raise the importance of maintaining the minimum distance to group nodes, while decreasing this penalty will raise the importance of all other restrictions. A high penalty for violating the minimum distance between edges and group nodes will produce edges that rather use a long route around group nodes to maintain the specified distance than pass through a small channel between two group nodes.
Use EdgeRouter.setMinimalNodeToEdgeDistance(double)
to set the minimum distance.
The value must be greater than or equal to 0
, otherwise the default value will be assigned.
Double.MAX_VALUE
as they easily lead to overflows and routing artifacts.penalty
 the penaltyEdgeRouter.setMinimalNodeToEdgeDistance(double)
public double getMinimalEdgeToEdgeDistancePenalty()
Increasing the minimum edge to edge distance penalty will raise the importance of maintaining the minimum distance to other edges, while decreasing this penalty will raise the importance of all other restrictions. When this penalty has a high value, edges will maintain the specified distance. This may also reduce the number of edges that pass through a small channel between nodes. So, if such a channel is part of the shortest routes for many edges, some of them will take a longer way.
Use EdgeLayoutDescriptor.setMinimalEdgeToEdgeDistance(double)
to set the minimum distance for a certain
edge to any other edge.
The value must be greater than or equal to 0
, otherwise the default value will be assigned.
Double.MAX_VALUE
as they easily lead to overflows and routing artifacts.setMinimalEdgeToEdgeDistancePenalty(double)
,
EdgeLayoutDescriptor.setMinimalEdgeToEdgeDistance(double)
public void setMinimalEdgeToEdgeDistancePenalty(double penalty)
Increasing the minimum edge to edge distance penalty will raise the importance of maintaining the minimum distance to other edges, while decreasing this penalty will raise the importance of all other restrictions. When this penalty has a high value, edges will maintain the specified distance. This may also reduce the number of edges that pass through a small channel between nodes. So, if such a channel is part of the shortest routes for many edges, some of them will take a longer way.
Use EdgeLayoutDescriptor.setMinimalEdgeToEdgeDistance(double)
to set the minimum distance for a certain
edge to any other edge.
The value must be greater than or equal to 0
, otherwise the default value will be assigned.
Double.MAX_VALUE
as they easily lead to overflows and routing artifacts.penalty
 the penaltyEdgeLayoutDescriptor.setMinimalEdgeToEdgeDistance(double)
public double getMinimalNodeCornerDistancePenalty()
Increasing the node corner distance penalty will raise the importance of maintaining the minimum distance to the corner of the adjacent nodes, while decreasing this penalty will raise the importance of all other restrictions.
Use EdgeLayoutDescriptor.setMinimalNodeCornerDistance(double)
to set the minimum node corner distance
for a certain edge.
The value must be greater than or equal to 0
, otherwise the default value will be assigned.
Double.MAX_VALUE
as they easily lead to overflows and routing artifacts.setMinimalNodeCornerDistancePenalty(double)
,
EdgeLayoutDescriptor.setMinimalNodeCornerDistance(double)
public void setMinimalNodeCornerDistancePenalty(double penalty)
Increasing the node corner distance penalty will raise the importance of maintaining the minimum distance to the corner of the adjacent nodes, while decreasing this penalty will raise the importance of all other restrictions.
Use EdgeLayoutDescriptor.setMinimalNodeCornerDistance(double)
to set the minimum node corner distance
for a certain edge.
The value must be greater than or equal to 0
, otherwise the default value will be assigned.
Double.MAX_VALUE
as they easily lead to overflows and routing artifacts.penalty
 the penaltyEdgeLayoutDescriptor.setMinimalNodeCornerDistance(double)
public double getMinimalFirstLastSegmentLengthPenalty()
Increasing the minimum first last segment length penalty will raise the importance of maintaining the first and last segment as long as they fit the minimum first/last segment length, while decreasing this penalty will raise the importance of all other restrictions.
Use EdgeLayoutDescriptor.setMinimalFirstSegmentLength(double)
to set the minimum length of the first
segment and EdgeLayoutDescriptor.setMinimalLastSegmentLength(double)
to set the minimum length of the
last segment of a certain edge.
The value must be greater than or equal to 0
, otherwise the default value will be assigned.
Double.MAX_VALUE
as they easily lead to overflows and routing artifacts.setMinimalFirstLastSegmentLengthPenalty(double)
,
EdgeLayoutDescriptor.setMinimalFirstSegmentLength(double)
,
EdgeLayoutDescriptor.setMinimalLastSegmentLength(double)
public void setMinimalFirstLastSegmentLengthPenalty(double penalty)
Increasing the minimum first last segment length penalty will raise the importance of maintaining the first and last segment as long as they fit the minimum first/last segment length, while decreasing this penalty will raise the importance of all other restrictions.
Use EdgeLayoutDescriptor.setMinimalFirstSegmentLength(double)
to set the minimum length of the first
segment and EdgeLayoutDescriptor.setMinimalLastSegmentLength(double)
to set the minimum length of the
last segment of a certain edge.
The value must be greater than or equal to 0
, otherwise the default value will be assigned.
Double.MAX_VALUE
as they easily lead to overflows and routing artifacts.penalty
 the penaltyEdgeLayoutDescriptor.setMinimalFirstSegmentLength(double)
,
EdgeLayoutDescriptor.setMinimalLastSegmentLength(double)
public double getBendsInNodeToEdgeDistancePenalty()
Increasing the bends in node to edge distance penalty will raise the importance of avoiding bends that violate the
minimum node to edge distance, while decreasing this penalty will raise the importance of all other restrictions.
This penalty supports EdgeRouter.getMinimalNodeToEdgeDistance()
. In case the path search finally reaches
the target node, the minimum node to edge distance for this node must be violated. Penalizing bends that are too
close to the node forces the edge to directly cross this distance and connect to the node.
The value must be greater than or equal to 0
, otherwise the default value will be assigned.
getMinimalNodeToEdgeDistancePenalty()
since they are used for the same feature.Double.MAX_VALUE
as they easily lead to overflows and routing artifacts.setBendsInNodeToEdgeDistancePenalty(double)
,
EdgeRouter.setMinimalNodeToEdgeDistance(double)
public void setBendsInNodeToEdgeDistancePenalty(double penalty)
Increasing the bends in node to edge distance penalty will raise the importance of avoiding bends that violate the
minimum node to edge distance, while decreasing this penalty will raise the importance of all other restrictions.
This penalty supports EdgeRouter.getMinimalNodeToEdgeDistance()
. In case the path search finally reaches
the target node, the minimum node to edge distance for this node must be violated. Penalizing bends that are too
close to the node forces the edge to directly cross this distance and connect to the node.
The value must be greater than or equal to 0
, otherwise the default value will be assigned.
getMinimalNodeToEdgeDistancePenalty()
since they are used for the same feature.Double.MAX_VALUE
as they easily lead to overflows and routing artifacts.penalty
 the penaltyEdgeRouter.setMinimalNodeToEdgeDistance(double)
public double getMonotonyViolationPenalty()
Increasing the monotony violation penalty will raise the importance of avoiding detours in the specified direction, while decreasing this penalty will raise the importance of all other restrictions.
Use EdgeLayoutDescriptor.setMonotonicPathRestriction(byte)
to set the monotonic path restrictions of a
certain edge.
The value must be greater than or equal to 0
, otherwise the default value will be assigned.
Double.MAX_VALUE
as they easily lead to overflows and routing artifacts.setMonotonyViolationPenalty(double)
,
EdgeLayoutDescriptor.setMonotonicPathRestriction(byte)
public void setMonotonyViolationPenalty(double penalty)
Increasing the monotony violation penalty will raise the importance of avoiding detours in the specified direction, while decreasing this penalty will raise the importance of all other restrictions.
Use EdgeLayoutDescriptor.setMonotonicPathRestriction(byte)
to set the monotonic path restrictions of a
certain edge.
The value must be greater than or equal to 0
, otherwise the default value will be assigned.
Double.MAX_VALUE
as they easily lead to overflows and routing artifacts.penalty
 the penaltyEdgeLayoutDescriptor.setMonotonicPathRestriction(byte)
public double getPartitionGridCellReentrancePenalty()
partition grid
cell.
This penalty will make routes that reenter the same partition grid cell more expensive than routes taking a more direct way.
Increasing the partition grid reentrance penalty will raise the importance of taking the most direct way through the partition grid, while decreasing this penalty will raise the importance of all other restrictions.
The value must be greater than or equal to 0
, otherwise the default value will be assigned.
Double.MAX_VALUE
as they easily lead to overflows and routing artifacts.setPartitionGridCellReentrancePenalty(double)
,
PartitionGrid
public void setPartitionGridCellReentrancePenalty(double penalty)
partition grid
cell.
This penalty will make routes that reenter the same partition grid cell more expensive than routes taking a more direct way.
Increasing the partition grid reentrance penalty will raise the importance of taking the most direct way through the partition grid, while decreasing this penalty will raise the importance of all other restrictions.
The value must be greater than or equal to 0
, otherwise the default value will be assigned.
Double.MAX_VALUE
as they easily lead to overflows and routing artifacts.penalty
 the penaltyPartitionGrid
public double getPortViolationPenalty()
PortCandidate
s or PortConstraint
s. This penalty will make routes that start or end at a point that doesn't comply with its
port constraints more expensive than routes that obey them.
Increasing the port violation penalty will raise the importance of maintaining port constraints, while decreasing this penalty will raise the importance of all other restrictions. It is recommended to have high penalties for port violation since the constraints lose purpose if they are disregarded.
The value must be greater than or equal to 0
, otherwise the default value will be assigned.
Double.MAX_VALUE
as they easily lead to overflows and routing artifacts.setPortViolationPenalty(double)
,
PortCandidate
,
PortConstraint
public void setPortViolationPenalty(double penalty)
PortCandidate
s or PortConstraint
s. This penalty will make routes that start or end at a point that doesn't comply with its
port constraints more expensive than routes that obey them.
Increasing the port violation penalty will raise the importance of maintaining port constraints, while decreasing this penalty will raise the importance of all other restrictions. It is recommended to have high penalties for port violation since the constraints lose purpose if they are disregarded.
The value must be greater than or equal to 0
, otherwise the default value will be assigned.
Double.MAX_VALUE
as they easily lead to overflows and routing artifacts.penalty
 the penaltyPortCandidate
,
PortConstraint
public double getInvalidEdgeGroupingPenalty()
Increasing the invalid edge grouping penalty will raise the importance of grouping edges with the same group ID, while decreasing this penalty will raise the importance of all other restrictions. As edge groups require that the route of an edge belonging to an edge group stays partly identical to the other edges of the group, the route may not be optimal with respect to the other restrictions. To maintain the edges together as long as possible, this penalty should be higher than most others.
Grouped edges have the same source or target group ID assigned in the data provider registered with the graph with
the PortConstraintKeys.SOURCE_GROUPID_KEY
or
PortConstraintKeys.TARGET_GROUPID_KEY
key.
The value must be greater than or equal to 0
, otherwise the default value will be assigned.
Double.MAX_VALUE
as they easily lead to overflows and routing artifacts.setInvalidEdgeGroupingPenalty(double)
,
PortConstraintKeys.SOURCE_GROUPID_KEY
,
PortConstraintKeys.TARGET_GROUPID_KEY
public void setInvalidEdgeGroupingPenalty(double penalty)
Increasing the invalid edge grouping penalty will raise the importance of grouping edges with the same group ID, while decreasing this penalty will raise the importance of all other restrictions. As edge groups require that the route of an edge belonging to an edge group stays partly identical to the other edges of the group, the route may not be optimal with respect to the other restrictions. To maintain the edges together as long as possible, this penalty should be higher than most others.
Grouped edges have the same source or target group ID assigned in the data provider registered with the graph with
the PortConstraintKeys.SOURCE_GROUPID_KEY
or
PortConstraintKeys.TARGET_GROUPID_KEY
key.
The value must be greater than or equal to 0
, otherwise the default value will be assigned.
Double.MAX_VALUE
as they easily lead to overflows and routing artifacts.penalty
 the penaltyPortConstraintKeys.SOURCE_GROUPID_KEY
,
PortConstraintKeys.TARGET_GROUPID_KEY
public double getSingleSideSelfLoopPenalty()
PortConstraint
s or
PortCandidate
s.
Increasing this penalty will stronger enforce routing the selfloops between two sides of the node but it will also require more time for determining the edge path. Decreasing the penalty may result in selfloops that only connect to one side of the node.
By default this value is set to 9
. The value must be >= 0
, otherwise the default
value will be assigned.
Double.MAX_VALUE
as they easily lead to overflows and routing artifacts.public void setSingleSideSelfLoopPenalty(double penalty)
PortConstraint
s or
PortCandidate
s.
Increasing this penalty will stronger enforce routing the selfloops between two sides of the node but it will also require more time for determining the edge path. Decreasing the penalty may result in selfloops that only connect to one side of the node.
By default this value is set to 9
. The value must be >= 0
, otherwise the default
value will be assigned.
Double.MAX_VALUE
as they easily lead to overflows and routing artifacts.penalty
 the penaltypublic PenaltySettings createCopy()
PenaltySettings
instance.
This implementation uses method newInstance()
to obtain a new instance which adopts all settings.
protected PenaltySettings newInstance()
PenaltySettings
.
This factory method is used by createCopy()
. Subclasses can override this method in order to return a
more specialized version.
PenaltySettings

© Copyright 20002022, yWorks GmbH. All rights reserved. 

PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: NESTED  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 