Search this API

y.layout.router.polyline
Class PenaltySettings

java.lang.Object
  extended by y.layout.router.polyline.PenaltySettings

public class PenaltySettings
extends java.lang.Object

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 PathSearchExtensions. 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.

 
The penalties are not independent. They will all influence the PathSearch together. Therefore, changing a certain penalty might not always lead to the desired effect for specific edges.
 
High values for the penalties may seem like a great idea to avoid certain conditions, but can cause all kinds of side effects and significantly increase the runtime when it is hard or even impossible to satisfy the condition. Thus, we recommend keeping the values in the range between 0 and 10000. It is especially discouraged to use maximum values like 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 PortCandidates or PortConstraints.
 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 self-loop 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 non-group 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 PortCandidates or PortConstraints.
 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 self-loop 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

OPTIMIZATION_BALANCED

public static final PenaltySettings OPTIMIZATION_BALANCED
Optimization strategy that balances bends and edge crossings in the edge routes. By default, this strategy is used for the path search.


OPTIMIZATION_EDGE_BENDS

public static final PenaltySettings OPTIMIZATION_EDGE_BENDS
Optimization strategy that minimizes bends in the edge routes. Edges may cross other edges to prevent bends occurring around them.


OPTIMIZATION_EDGE_CROSSINGS

public static final PenaltySettings OPTIMIZATION_EDGE_CROSSINGS
Optimization strategy that minimizes edge crossings in the edge routes. This may cause more bends.


OPTIMIZATION_EDGE_LENGTHS

public static final PenaltySettings OPTIMIZATION_EDGE_LENGTHS
Optimization strategy that minimizes the length of the edge routes. In consequence, there may be more edge crossings.

Constructor Detail

PenaltySettings

protected PenaltySettings()
Creates a new instance of PenaltySettings.

Method Detail

getSketchViolationPenalty

public 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. For other policies this value is ignored.

This penalty is mainly considered during a post-processing step that tries to correct the current route. For larger penalty values, the algorithm may remove tiny non-orthogonal segments. In addition, larger values make it more likely that the algorithm considers a non-orthogonal 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.

Returns:
the penalty
See Also:
setSketchViolationPenalty(double)

setSketchViolationPenalty

public 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. For other policies this value is ignored.

This penalty is mainly considered during a post-processing step that tries to correct the current route. For larger penalty values, the algorithm may remove tiny non-orthogonal segments. In addition, larger values make it more likely that the algorithm considers a non-orthogonal 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.

Default Value:
The default value is 4.5.
Parameters:
penalty - the penalty
See Also:
EdgeLayoutDescriptor.ROUTING_POLICY_SEGMENTS_AS_NEEDED

getEdgeLengthPenalty

public double getEdgeLengthPenalty()
Returns the penalty for the edge length. This penalty will make long routes more expensive than short routes so edges will preferably be kept short.

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.
 
High values for the penalties may seem like a great idea to avoid certain conditions, but can cause all kinds of side effects and significantly increase the runtime when it is hard or even impossible to satisfy the condition. Thus, we recommend keeping the values in the range between 0 and 10000. It is especially discouraged to use maximum values like Double.MAX_VALUE as they easily lead to overflows and routing artifacts.
Returns:
the penalty
See Also:
setEdgeLengthPenalty(double)

setEdgeLengthPenalty

public void setEdgeLengthPenalty(double penalty)
Sets the penalty for the edge length. This penalty will make long routes more expensive than short routes so edges will preferably be kept short.

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.
 
High values for the penalties may seem like a great idea to avoid certain conditions, but can cause all kinds of side effects and significantly increase the runtime when it is hard or even impossible to satisfy the condition. Thus, we recommend keeping the values in the range between 0 and 10000. It is especially discouraged to use maximum values like Double.MAX_VALUE as they easily lead to overflows and routing artifacts.
Default Value:
The default value is 2.
Parameters:
penalty - the penalty

getBendPenalty

public double getBendPenalty()
Returns the penalty for an edge bend. This penalty will make routes with many bends more expensive than routes with few or no bends. Hence, edges will have preferably few bends.

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.
 
A very small bend penalty (less than 1) can lead to squiggles when the algorithm tries to avoid more expensive restrictions.
 
High values for the penalties may seem like a great idea to avoid certain conditions, but can cause all kinds of side effects and significantly increase the runtime when it is hard or even impossible to satisfy the condition. Thus, we recommend keeping the values in the range between 0 and 10000. It is especially discouraged to use maximum values like Double.MAX_VALUE as they easily lead to overflows and routing artifacts.
Returns:
the penalty
See Also:
setBendPenalty(double)

setBendPenalty

public void setBendPenalty(double penalty)
Specifies the penalty for an edge bend. This penalty will make routes with many bends more expensive than routes with few or no bends. Hence, edges will have preferably few bends.

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.
 
A very small bend penalty (less than 1) can lead to squiggles when the algorithm tries to avoid more expensive restrictions.
 
High values for the penalties may seem like a great idea to avoid certain conditions, but can cause all kinds of side effects and significantly increase the runtime when it is hard or even impossible to satisfy the condition. Thus, we recommend keeping the values in the range between 0 and 10000. It is especially discouraged to use maximum values like Double.MAX_VALUE as they easily lead to overflows and routing artifacts.
Default Value:
The default value is 3.
Parameters:
penalty - the penalty

getEdgeCrossingPenalty

public double getEdgeCrossingPenalty()
Returns the penalty for a crossing of two edges. This penalty will make routes that cross many other edges more expensive than routes that cross few other edges or no edges at all. Hence, edges preferably won't cross other edges. Crossings between adjacent edges (edges having a common end node) are not covered by this penalty - their cost is defined by 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.
 
High values for the penalties may seem like a great idea to avoid certain conditions, but can cause all kinds of side effects and significantly increase the runtime when it is hard or even impossible to satisfy the condition. Thus, we recommend keeping the values in the range between 0 and 10000. It is especially discouraged to use maximum values like Double.MAX_VALUE as they easily lead to overflows and routing artifacts.
Returns:
the penalty
See Also:
setEdgeCrossingPenalty(double), setAdjacentEdgeCrossingPenalty(double)

setEdgeCrossingPenalty

public void setEdgeCrossingPenalty(double penalty)
Specifies the penalty for a crossing of two edges. This penalty will make routes that cross many other edges more expensive than routes that cross few other edges or no edges at all. Hence, edges preferably won't cross other edges. Crossings between adjacent edges (edges having a common end node) are not covered by this penalty - their cost is defined by 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.
 
High values for the penalties may seem like a great idea to avoid certain conditions, but can cause all kinds of side effects and significantly increase the runtime when it is hard or even impossible to satisfy the condition. Thus, we recommend keeping the values in the range between 0 and 10000. It is especially discouraged to use maximum values like Double.MAX_VALUE as they easily lead to overflows and routing artifacts.
Default Value:
The default value is 1.
Parameters:
penalty - the penalty
See Also:
setAdjacentEdgeCrossingPenalty(double)

getAdjacentEdgeCrossingPenalty

public double getAdjacentEdgeCrossingPenalty()
Returns the penalty for a crossing of two edges that are adjacent, that is, share a common node.

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 non-adjacent 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.
Returns:
the penalty
See Also:
setAdjacentEdgeCrossingPenalty(double), setEdgeCrossingPenalty(double)

setAdjacentEdgeCrossingPenalty

public void setAdjacentEdgeCrossingPenalty(double penalty)
Specifies the penalty for a crossing of two edges that are adjacent, that is, share a common node.

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 non-adjacent 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.
Default Value:
The default value is 7.
Parameters:
penalty - the penalty
See Also:
setEdgeCrossingPenalty(double)

getSelfCrossingPenalty

public double getSelfCrossingPenalty()
Returns the penalty for a crossing of two segments that belong the same edge.

This penalty only induces costs for crossings between edge segments that are part of the same actual edge. Avoiding such self-crossings 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.

Returns:
the penalty
See Also:
setSelfCrossingPenalty(double), setEdgeCrossingPenalty(double), setAdjacentEdgeCrossingPenalty(double)

setSelfCrossingPenalty

public void setSelfCrossingPenalty(double penalty)
Specifies the penalty for a crossing of two segments that belong the same edge.

This penalty only induces costs for crossings between edge segments that are part of the same actual edge. Avoiding such self-crossings 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.

Default Value:
The default value is 50.
Parameters:
penalty - the penalty
See Also:
setEdgeCrossingPenalty(double), setAdjacentEdgeCrossingPenalty(double)

getNodeCrossingPenalty

public double getNodeCrossingPenalty()
Returns the penalty for an edge crossing a regular node. This penalty will make routes that cross normal nodes more expensive than routes that avoid crossing nodes. Hence, edges won't preferably cross any nodes.

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.

 
The node crossing penalty should always be one of the highest penalties to make sure that edges are routed around nodes.
 
High values for the penalties may seem like a great idea to avoid certain conditions, but can cause all kinds of side effects and significantly increase the runtime when it is hard or even impossible to satisfy the condition. Thus, we recommend keeping the values in the range between 0 and 10000. It is especially discouraged to use maximum values like Double.MAX_VALUE as they easily lead to overflows and routing artifacts.
Returns:
the penalty
See Also:
setNodeCrossingPenalty(double)

setNodeCrossingPenalty

public void setNodeCrossingPenalty(double penalty)
Specifies the penalty for an edge crossing a regular node. This penalty will make routes that cross normal nodes more expensive than routes that avoid crossing nodes. Hence, edges won't preferably cross any nodes.

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.

 
The node crossing penalty should always be one of the highest penalties to make sure that edges are routed around nodes.
 
High values for the penalties may seem like a great idea to avoid certain conditions, but can cause all kinds of side effects and significantly increase the runtime when it is hard or even impossible to satisfy the condition. Thus, we recommend keeping the values in the range between 0 and 10000. It is especially discouraged to use maximum values like Double.MAX_VALUE as they easily lead to overflows and routing artifacts.
Default Value:
The default value is 3000.
Parameters:
penalty - the penalty

getGroupNodeCrossingPenalty

public double getGroupNodeCrossingPenalty()
Returns the penalty for an edge crossing a group node. This penalty will make routes that cross group nodes more expensive than routes that avoid crossing group nodes. Hence, edges won't preferably cross any group nodes.

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.

 
Like 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.
 
High values for the penalties may seem like a great idea to avoid certain conditions, but can cause all kinds of side effects and significantly increase the runtime when it is hard or even impossible to satisfy the condition. Thus, we recommend keeping the values in the range between 0 and 10000. It is especially discouraged to use maximum values like Double.MAX_VALUE as they easily lead to overflows and routing artifacts.
Returns:
the penalty
See Also:
setGroupNodeCrossingPenalty(double)

setGroupNodeCrossingPenalty

public void setGroupNodeCrossingPenalty(double penalty)
Specifies the penalty for an edge crossing a group node. This penalty will make routes that cross group nodes more expensive than routes that avoid crossing group nodes. Hence, edges won't preferably cross any group nodes.

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.

 
Like 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.
 
High values for the penalties may seem like a great idea to avoid certain conditions, but can cause all kinds of side effects and significantly increase the runtime when it is hard or even impossible to satisfy the condition. Thus, we recommend keeping the values in the range between 0 and 10000. It is especially discouraged to use maximum values like Double.MAX_VALUE as they easily lead to overflows and routing artifacts.
Default Value:
The default value is 60.
Parameters:
penalty - the penalty

getNodeLabelCrossingPenalty

public double getNodeLabelCrossingPenalty()
Returns the penalty for an edge crossing a node label. This penalty will make routes that cross node labels more expensive than routes that avoid crossing node labels. Hence, edges won't preferably cross any node labels.

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.

 
This only applies to labels that are placed outside the bounds of their owner nodes as long as the 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.
 
High values for the penalties may seem like a great idea to avoid certain conditions, but can cause all kinds of side effects and significantly increase the runtime when it is hard or even impossible to satisfy the condition. Thus, we recommend keeping the values in the range between 0 and 10000. It is especially discouraged to use maximum values like Double.MAX_VALUE as they easily lead to overflows and routing artifacts.
Returns:
the penalty
See Also:
setNodeLabelCrossingPenalty(double), EdgeRouter.setConsiderNodeLabelsEnabled(boolean)

setNodeLabelCrossingPenalty

public void setNodeLabelCrossingPenalty(double penalty)
Specifies the penalty for an edge crossing a node label. This penalty will make routes that cross node labels more expensive than routes that avoid crossing node labels. Hence, edges won't preferably cross any node labels.

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.

 
This only applies to labels that are placed outside the bounds of their owner nodes as long as the 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.
 
High values for the penalties may seem like a great idea to avoid certain conditions, but can cause all kinds of side effects and significantly increase the runtime when it is hard or even impossible to satisfy the condition. Thus, we recommend keeping the values in the range between 0 and 10000. It is especially discouraged to use maximum values like Double.MAX_VALUE as they easily lead to overflows and routing artifacts.
Default Value:
The default value is 13.
Parameters:
penalty - the penalty
See Also:
EdgeRouter.setConsiderNodeLabelsEnabled(boolean)

getEdgeLabelCrossingPenalty

public double getEdgeLabelCrossingPenalty()
Returns the penalty for an edge crossing an edge label. This penalty will make routes that cross edge labels of fixed edges more expensive than routes that avoid crossing edge labels, so edges won't preferably cross any edge labels that belong to fixed edges.

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.

 
High values for the penalties may seem like a great idea to avoid certain conditions, but can cause all kinds of side effects and significantly increase the runtime when it is hard or even impossible to satisfy the condition. Thus, we recommend keeping the values in the range between 0 and 10000. It is especially discouraged to use maximum values like Double.MAX_VALUE as they easily lead to overflows and routing artifacts.
Returns:
the penalty
See Also:
setEdgeLabelCrossingPenalty(double), EdgeRouter.setConsiderEdgeLabelsEnabled(boolean)

setEdgeLabelCrossingPenalty

public void setEdgeLabelCrossingPenalty(double penalty)
Specifies the penalty for an edge crossing an edge label. This penalty will make routes that cross edge labels of fixed edges more expensive than routes that avoid crossing edge labels, so edges won't preferably cross any edge labels that belong to fixed edges.

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.

 
High values for the penalties may seem like a great idea to avoid certain conditions, but can cause all kinds of side effects and significantly increase the runtime when it is hard or even impossible to satisfy the condition. Thus, we recommend keeping the values in the range between 0 and 10000. It is especially discouraged to use maximum values like Double.MAX_VALUE as they easily lead to overflows and routing artifacts.
Default Value:
The default value is 13.
Parameters:
penalty - the penalty
See Also:
EdgeRouter.setConsiderEdgeLabelsEnabled(boolean)

getMinimalNodeToEdgeDistancePenalty

public double getMinimalNodeToEdgeDistancePenalty()
Returns the penalty for violations of the minimum distance between any edge and any normal node side. This penalty will make routes that pass too close to normal nodes more expensive than routes that maintain the specified minimum node to edge distance.

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.

 
High values for the penalties may seem like a great idea to avoid certain conditions, but can cause all kinds of side effects and significantly increase the runtime when it is hard or even impossible to satisfy the condition. Thus, we recommend keeping the values in the range between 0 and 10000. It is especially discouraged to use maximum values like Double.MAX_VALUE as they easily lead to overflows and routing artifacts.
Returns:
the penalty
See Also:
setMinimalNodeToEdgeDistancePenalty(double), EdgeRouter.setMinimalNodeToEdgeDistance(double)

setMinimalNodeToEdgeDistancePenalty

public void setMinimalNodeToEdgeDistancePenalty(double penalty)
Specifies the penalty for violations of the minimum distance between any edge and any non-group node side. This penalty will make routes that pass too close to normal nodes more expensive than routes that maintain the specified minimum node to edge distance.

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.

 
High values for the penalties may seem like a great idea to avoid certain conditions, but can cause all kinds of side effects and significantly increase the runtime when it is hard or even impossible to satisfy the condition. Thus, we recommend keeping the values in the range between 0 and 10000. It is especially discouraged to use maximum values like Double.MAX_VALUE as they easily lead to overflows and routing artifacts.
Default Value:
The default value is 10.
Parameters:
penalty - the penalty
See Also:
EdgeRouter.setMinimalNodeToEdgeDistance(double)

getMinimalGroupNodeToEdgeDistancePenalty

public double getMinimalGroupNodeToEdgeDistancePenalty()
Returns the penalty for violations of the minimum distance between any edge and any group node side. This penalty will make routes that pass group nodes too close more expensive than routes that maintain the specified minimum node to edge distance.

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.

 
High values for the penalties may seem like a great idea to avoid certain conditions, but can cause all kinds of side effects and significantly increase the runtime when it is hard or even impossible to satisfy the condition. Thus, we recommend keeping the values in the range between 0 and 10000. It is especially discouraged to use maximum values like Double.MAX_VALUE as they easily lead to overflows and routing artifacts.
Returns:
the penalty
See Also:
setMinimalGroupNodeToEdgeDistancePenalty(double), EdgeRouter.setMinimalNodeToEdgeDistance(double)

setMinimalGroupNodeToEdgeDistancePenalty

public void setMinimalGroupNodeToEdgeDistancePenalty(double penalty)
Specifies the penalty for violations of the minimum distance between any edge and any group node side. This penalty will make routes that pass group nodes too close more expensive than routes that maintain the specified minimum node to edge distance.

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.

 
High values for the penalties may seem like a great idea to avoid certain conditions, but can cause all kinds of side effects and significantly increase the runtime when it is hard or even impossible to satisfy the condition. Thus, we recommend keeping the values in the range between 0 and 10000. It is especially discouraged to use maximum values like Double.MAX_VALUE as they easily lead to overflows and routing artifacts.
Default Value:
The default value is 10.
Parameters:
penalty - the penalty
See Also:
EdgeRouter.setMinimalNodeToEdgeDistance(double)

getMinimalEdgeToEdgeDistancePenalty

public double getMinimalEdgeToEdgeDistancePenalty()
Returns the penalty for violations of the minimum distance between any two edges. This penalty will make routes that pass other edges too close more expensive than routes that maintain the specified minimum edge to edge distance.

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.

 
High values for the penalties may seem like a great idea to avoid certain conditions, but can cause all kinds of side effects and significantly increase the runtime when it is hard or even impossible to satisfy the condition. Thus, we recommend keeping the values in the range between 0 and 10000. It is especially discouraged to use maximum values like Double.MAX_VALUE as they easily lead to overflows and routing artifacts.
Returns:
the penalty
See Also:
setMinimalEdgeToEdgeDistancePenalty(double), EdgeLayoutDescriptor.setMinimalEdgeToEdgeDistance(double)

setMinimalEdgeToEdgeDistancePenalty

public void setMinimalEdgeToEdgeDistancePenalty(double penalty)
Specifies the penalty for violations of the minimum distance between any two edges. This penalty will make routes that pass other edges too close more expensive than routes that maintain the specified minimum edge to edge distance.

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.

 
High values for the penalties may seem like a great idea to avoid certain conditions, but can cause all kinds of side effects and significantly increase the runtime when it is hard or even impossible to satisfy the condition. Thus, we recommend keeping the values in the range between 0 and 10000. It is especially discouraged to use maximum values like Double.MAX_VALUE as they easily lead to overflows and routing artifacts.
Default Value:
The default value is 5.
Parameters:
penalty - the penalty
See Also:
EdgeLayoutDescriptor.setMinimalEdgeToEdgeDistance(double)

getMinimalNodeCornerDistancePenalty

public double getMinimalNodeCornerDistancePenalty()
Returns the penalty for violations of the minimum distance the edge shall maintain from node corners when entering or leaving the node. This penalty will make routes that end too close to the corner of their source or target node more expensive than routes that maintain the specified minimum node corner distance.

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.

 
High values for the penalties may seem like a great idea to avoid certain conditions, but can cause all kinds of side effects and significantly increase the runtime when it is hard or even impossible to satisfy the condition. Thus, we recommend keeping the values in the range between 0 and 10000. It is especially discouraged to use maximum values like Double.MAX_VALUE as they easily lead to overflows and routing artifacts.
Returns:
the penalty
See Also:
setMinimalNodeCornerDistancePenalty(double), EdgeLayoutDescriptor.setMinimalNodeCornerDistance(double)

setMinimalNodeCornerDistancePenalty

public 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. This penalty will make routes that end too close to the corner of their source or target node more expensive than routes that maintain the specified minimum node corner distance.

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.

 
High values for the penalties may seem like a great idea to avoid certain conditions, but can cause all kinds of side effects and significantly increase the runtime when it is hard or even impossible to satisfy the condition. Thus, we recommend keeping the values in the range between 0 and 10000. It is especially discouraged to use maximum values like Double.MAX_VALUE as they easily lead to overflows and routing artifacts.
Default Value:
The default value is 6.
Parameters:
penalty - the penalty
See Also:
EdgeLayoutDescriptor.setMinimalNodeCornerDistance(double)

getMinimalFirstLastSegmentLengthPenalty

public double getMinimalFirstLastSegmentLengthPenalty()
Returns the penalty for violations of the minimum length of the first and last segment of an edge. This penalty will make routes whose first/last bend is too close to their source or target node more expensive than routes that maintain the specified minimum first/last segment length.

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.

 
High values for the penalties may seem like a great idea to avoid certain conditions, but can cause all kinds of side effects and significantly increase the runtime when it is hard or even impossible to satisfy the condition. Thus, we recommend keeping the values in the range between 0 and 10000. It is especially discouraged to use maximum values like Double.MAX_VALUE as they easily lead to overflows and routing artifacts.
Returns:
the penalty
See Also:
setMinimalFirstLastSegmentLengthPenalty(double), EdgeLayoutDescriptor.setMinimalFirstSegmentLength(double), EdgeLayoutDescriptor.setMinimalLastSegmentLength(double)

setMinimalFirstLastSegmentLengthPenalty

public void setMinimalFirstLastSegmentLengthPenalty(double penalty)
Specifies the penalty for violations of the minimum length of the first and last segment of an edge. This penalty will make routes whose first/last bend is too close to their source or target node more expensive than routes that maintain the specified minimum first/last segment length.

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.

 
High values for the penalties may seem like a great idea to avoid certain conditions, but can cause all kinds of side effects and significantly increase the runtime when it is hard or even impossible to satisfy the condition. Thus, we recommend keeping the values in the range between 0 and 10000. It is especially discouraged to use maximum values like Double.MAX_VALUE as they easily lead to overflows and routing artifacts.
Default Value:
The default value is 12.
Parameters:
penalty - the penalty
See Also:
EdgeLayoutDescriptor.setMinimalFirstSegmentLength(double), EdgeLayoutDescriptor.setMinimalLastSegmentLength(double)

getBendsInNodeToEdgeDistancePenalty

public 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. This penalty will make routes that bend too close to their source or target node more expensive than routes that maintain the specified minimum node to edge distance.

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.

 
In principle, this penalty can always be set to the same value as getMinimalNodeToEdgeDistancePenalty() since they are used for the same feature.
 
High values for the penalties may seem like a great idea to avoid certain conditions, but can cause all kinds of side effects and significantly increase the runtime when it is hard or even impossible to satisfy the condition. Thus, we recommend keeping the values in the range between 0 and 10000. It is especially discouraged to use maximum values like Double.MAX_VALUE as they easily lead to overflows and routing artifacts.
Returns:
the penalty
See Also:
setBendsInNodeToEdgeDistancePenalty(double), EdgeRouter.setMinimalNodeToEdgeDistance(double)

setBendsInNodeToEdgeDistancePenalty

public 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. This penalty will make routes that bend too close to their source or target node more expensive than routes that maintain the specified minimum node to edge distance.

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.

 
In principle, this penalty can always be set to the same value as getMinimalNodeToEdgeDistancePenalty() since they are used for the same feature.
 
High values for the penalties may seem like a great idea to avoid certain conditions, but can cause all kinds of side effects and significantly increase the runtime when it is hard or even impossible to satisfy the condition. Thus, we recommend keeping the values in the range between 0 and 10000. It is especially discouraged to use maximum values like Double.MAX_VALUE as they easily lead to overflows and routing artifacts.
Default Value:
The default value is 10.
Parameters:
penalty - the penalty
See Also:
EdgeRouter.setMinimalNodeToEdgeDistance(double)

getMonotonyViolationPenalty

public double getMonotonyViolationPenalty()
Returns the penalty for violating the monotonic path restrictions of an edge. This penalty will make routes with detours more expensive than routes that stay monotone.

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.

 
High values for the penalties may seem like a great idea to avoid certain conditions, but can cause all kinds of side effects and significantly increase the runtime when it is hard or even impossible to satisfy the condition. Thus, we recommend keeping the values in the range between 0 and 10000. It is especially discouraged to use maximum values like Double.MAX_VALUE as they easily lead to overflows and routing artifacts.
Returns:
the penalty
See Also:
setMonotonyViolationPenalty(double), EdgeLayoutDescriptor.setMonotonicPathRestriction(byte)

setMonotonyViolationPenalty

public void setMonotonyViolationPenalty(double penalty)
Specifies the penalty for violating the monotonic path restrictions of an edge. This penalty will make routes with detours m ore expensive than routes that stay monotone.

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.

 
High values for the penalties may seem like a great idea to avoid certain conditions, but can cause all kinds of side effects and significantly increase the runtime when it is hard or even impossible to satisfy the condition. Thus, we recommend keeping the values in the range between 0 and 10000. It is especially discouraged to use maximum values like Double.MAX_VALUE as they easily lead to overflows and routing artifacts.
Default Value:
The default value is 14.
Parameters:
penalty - the penalty
See Also:
EdgeLayoutDescriptor.setMonotonicPathRestriction(byte)

getPartitionGridCellReentrancePenalty

public double getPartitionGridCellReentrancePenalty()
Returns the penalty for an edge leaving and reentering in the same partition grid cell. This penalty will make routes that re-enter 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.

 
High values for the penalties may seem like a great idea to avoid certain conditions, but can cause all kinds of side effects and significantly increase the runtime when it is hard or even impossible to satisfy the condition. Thus, we recommend keeping the values in the range between 0 and 10000. It is especially discouraged to use maximum values like Double.MAX_VALUE as they easily lead to overflows and routing artifacts.
Returns:
the penalty
See Also:
setPartitionGridCellReentrancePenalty(double), PartitionGrid

setPartitionGridCellReentrancePenalty

public void setPartitionGridCellReentrancePenalty(double penalty)
Specifies the penalty for an edge leaving and reentering in the same partition grid cell. This penalty will make routes that re-enter 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.

 
High values for the penalties may seem like a great idea to avoid certain conditions, but can cause all kinds of side effects and significantly increase the runtime when it is hard or even impossible to satisfy the condition. Thus, we recommend keeping the values in the range between 0 and 10000. It is especially discouraged to use maximum values like Double.MAX_VALUE as they easily lead to overflows and routing artifacts.
Default Value:
The default value is 7.
Parameters:
penalty - the penalty
See Also:
PartitionGrid

getPortViolationPenalty

public double getPortViolationPenalty()
Returns the penalty if an edge does not comply with its PortCandidates or PortConstraints. 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.

 
High values for the penalties may seem like a great idea to avoid certain conditions, but can cause all kinds of side effects and significantly increase the runtime when it is hard or even impossible to satisfy the condition. Thus, we recommend keeping the values in the range between 0 and 10000. It is especially discouraged to use maximum values like Double.MAX_VALUE as they easily lead to overflows and routing artifacts.
Returns:
the penalty
See Also:
setPortViolationPenalty(double), PortCandidate, PortConstraint

setPortViolationPenalty

public void setPortViolationPenalty(double penalty)
Specifies the penalty if an edge does not comply with its PortCandidates or PortConstraints. 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.

 
High values for the penalties may seem like a great idea to avoid certain conditions, but can cause all kinds of side effects and significantly increase the runtime when it is hard or even impossible to satisfy the condition. Thus, we recommend keeping the values in the range between 0 and 10000. It is especially discouraged to use maximum values like Double.MAX_VALUE as they easily lead to overflows and routing artifacts.
Default Value:
The default value is 10000.
Parameters:
penalty - the penalty
See Also:
PortCandidate, PortConstraint

getInvalidEdgeGroupingPenalty

public double getInvalidEdgeGroupingPenalty()
Returns the penalty for an edge with a group ID that is not grouped at source or target side. This penalty will make routes for grouped edges that don't use partly the same path as the other edges in this group more expensive than routes that stick to the group.

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.

 
High values for the penalties may seem like a great idea to avoid certain conditions, but can cause all kinds of side effects and significantly increase the runtime when it is hard or even impossible to satisfy the condition. Thus, we recommend keeping the values in the range between 0 and 10000. It is especially discouraged to use maximum values like Double.MAX_VALUE as they easily lead to overflows and routing artifacts.
Returns:
the penalty
See Also:
setInvalidEdgeGroupingPenalty(double), PortConstraintKeys.SOURCE_GROUPID_KEY, PortConstraintKeys.TARGET_GROUPID_KEY

setInvalidEdgeGroupingPenalty

public void setInvalidEdgeGroupingPenalty(double penalty)
Specifies the penalty for an edge with a group ID that is not grouped at source or target side. This penalty will make routes for grouped edges that don't use partly the same path as the other edges in this group more expensive than routes that stick to the group.

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.

 
High values for the penalties may seem like a great idea to avoid certain conditions, but can cause all kinds of side effects and significantly increase the runtime when it is hard or even impossible to satisfy the condition. Thus, we recommend keeping the values in the range between 0 and 10000. It is especially discouraged to use maximum values like Double.MAX_VALUE as they easily lead to overflows and routing artifacts.
Default Value:
The default value is 25.
Parameters:
penalty - the penalty
See Also:
PortConstraintKeys.SOURCE_GROUPID_KEY, PortConstraintKeys.TARGET_GROUPID_KEY

getSingleSideSelfLoopPenalty

public double getSingleSideSelfLoopPenalty()
Returns the penalty for bends of a self-loop edge. This penalty will make self-loops leave and enter the node at different sides unless they are forced to one side by PortConstraints or PortCandidates.

Increasing this penalty will stronger enforce routing the self-loops between two sides of the node but it will also require more time for determining the edge path. Decreasing the penalty may result in self-loops 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.

 
High values for the penalties may seem like a great idea to avoid certain conditions, but can cause all kinds of side effects and significantly increase the runtime when it is hard or even impossible to satisfy the condition. Thus, we recommend keeping the values in the range between 0 and 10000. It is especially discouraged to use maximum values like Double.MAX_VALUE as they easily lead to overflows and routing artifacts.
Returns:
the penalty

setSingleSideSelfLoopPenalty

public void setSingleSideSelfLoopPenalty(double penalty)
Sets the penalty for bends of a self-loop edge. This penalty will make self-loops leave and enter the node at different sides unless they are forced to one side by PortConstraints or PortCandidates.

Increasing this penalty will stronger enforce routing the self-loops between two sides of the node but it will also require more time for determining the edge path. Decreasing the penalty may result in self-loops 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.

 
High values for the penalties may seem like a great idea to avoid certain conditions, but can cause all kinds of side effects and significantly increase the runtime when it is hard or even impossible to satisfy the condition. Thus, we recommend keeping the values in the range between 0 and 10000. It is especially discouraged to use maximum values like Double.MAX_VALUE as they easily lead to overflows and routing artifacts.
Parameters:
penalty - the penalty

createCopy

public PenaltySettings createCopy()
Creates a copy of this PenaltySettings instance.

This implementation uses method newInstance() to obtain a new instance which adopts all settings.

Returns:
a copy of this instance

newInstance

protected PenaltySettings newInstance()
Creates a new instance of PenaltySettings.

This factory method is used by createCopy(). Subclasses can override this method in order to return a more specialized version.

Returns:
a specialized PenaltySettings

© Copyright 2000-2022,
yWorks GmbH.
All rights reserved.