public class PenaltySettings extends Object
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.Modifier and Type | Field and Description |
---|---|
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.
|
Modifier | Constructor and Description |
---|---|
protected |
PenaltySettings()
Creates a new instance of
PenaltySettings . |
Modifier and Type | Method and Description |
---|---|
PenaltySettings |
createCopy()
Creates a copy of this
PenaltySettings instance. |
double |
getBendPenalty()
Gets the penalty for an edge bend.
|
double |
getBendsInNodeToEdgeDistancePenalty()
Gets 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()
Gets the penalty for a crossing of two edges.
|
double |
getEdgeLabelCrossingPenalty()
Gets the penalty for an edge crossing an edge label.
|
double |
getEdgeLengthPenalty()
Gets the penalty for the edge length.
|
double |
getGroupNodeCrossingPenalty()
Gets the penalty for an edge crossing a group node.
|
double |
getInvalidEdgeGroupingPenalty()
Gets the penalty for an edge with a group ID that is not grouped at source or target side.
|
double |
getMinimumEdgeToEdgeDistancePenalty()
Gets the penalty for violations of the minimum distance between any two edges.
|
double |
getMinimumFirstLastSegmentLengthPenalty()
Gets the penalty for violations of the minimum length of the first and last segment of an edge.
|
double |
getMinimumGroupNodeToEdgeDistancePenalty()
Gets the penalty for violations of the minimum distance between any edge and any group node side.
|
double |
getMinimumNodeCornerDistancePenalty()
Gets the penalty for violations of the minimum distance the edge shall maintain from node corners when entering or
leaving the node.
|
double |
getMinimumNodeToEdgeDistancePenalty()
Gets the penalty for violations of the minimum distance between any edge and any normal node side.
|
double |
getMonotonyViolationPenalty()
Gets the penalty for violating the monotonic path restrictions of an edge.
|
double |
getNodeCrossingPenalty()
Gets the penalty for an edge crossing a regular node.
|
double |
getNodeLabelCrossingPenalty()
Gets the penalty for an edge crossing a node label.
|
double |
getPartitionGridCellReentrancePenalty()
Gets the penalty for an edge leaving and reentering in the same
partition grid
cell. |
double |
getPortViolationPenalty()
Gets the penalty if an edge does not comply with its
PortCandidate s or
PortConstraint s. |
double |
getSingleSideSelfLoopPenalty()
Gets the penalty for bends of a self-loop edge.
|
protected PenaltySettings |
newInstance()
Creates a new instance of
PenaltySettings . |
void |
setBendPenalty(double value)
Sets the penalty for an edge bend.
|
void |
setBendsInNodeToEdgeDistancePenalty(double value)
Sets 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 value)
Sets the penalty for a crossing of two edges.
|
void |
setEdgeLabelCrossingPenalty(double value)
Sets the penalty for an edge crossing an edge label.
|
void |
setEdgeLengthPenalty(double value)
Sets the penalty for the edge length.
|
void |
setGroupNodeCrossingPenalty(double value)
Sets the penalty for an edge crossing a group node.
|
void |
setInvalidEdgeGroupingPenalty(double value)
Sets the penalty for an edge with a group ID that is not grouped at source or target side.
|
void |
setMinimumEdgeToEdgeDistancePenalty(double value)
Sets the penalty for violations of the minimum distance between any two edges.
|
void |
setMinimumFirstLastSegmentLengthPenalty(double value)
Sets the penalty for violations of the minimum length of the first and last segment of an edge.
|
void |
setMinimumGroupNodeToEdgeDistancePenalty(double value)
Sets the penalty for violations of the minimum distance between any edge and any group node side.
|
void |
setMinimumNodeCornerDistancePenalty(double value)
Sets the penalty for violations of the minimum distance the edge shall maintain from node corners when entering or
leaving the node.
|
void |
setMinimumNodeToEdgeDistancePenalty(double value)
Sets the penalty for violations of the minimum distance between any edge and any normal node side.
|
void |
setMonotonyViolationPenalty(double value)
Sets the penalty for violating the monotonic path restrictions of an edge.
|
void |
setNodeCrossingPenalty(double value)
Sets the penalty for an edge crossing a regular node.
|
void |
setNodeLabelCrossingPenalty(double value)
Sets the penalty for an edge crossing a node label.
|
void |
setPartitionGridCellReentrancePenalty(double value)
Sets the penalty for an edge leaving and reentering in the same
partition grid
cell. |
void |
setPortViolationPenalty(double value)
Sets the penalty if an edge does not comply with its
PortCandidate s or
PortConstraint s. |
void |
setSingleSideSelfLoopPenalty(double value)
Sets the penalty for bends of a self-loop edge.
|
public static final PenaltySettings OPTIMIZATION_BALANCED
By default, this strategy is used for the path search.
public static final PenaltySettings OPTIMIZATION_EDGE_BENDS
Edges may cross other edges to prevent bends occurring around them.
public static final PenaltySettings OPTIMIZATION_EDGE_CROSSINGS
This may cause more bends.
public static final PenaltySettings OPTIMIZATION_EDGE_LENGTHS
In consequence, there may be more edge crossings.
protected PenaltySettings()
PenaltySettings
.public PenaltySettings createCopy()
PenaltySettings
instance.
This implementation uses method newInstance()
to obtain a new instance which adopts all settings.
public double getBendPenalty()
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.1
) can lead to squiggles when the algorithm tries to avoid more expensive restrictions.setBendPenalty(double)
public double getBendsInNodeToEdgeDistancePenalty()
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
MinimumNodeToEdgeDistance
.
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.
MinimumNodeToEdgeDistancePenalty
since they are used for the same feature.EdgeRouter.setMinimumNodeToEdgeDistance(double)
,
setBendsInNodeToEdgeDistancePenalty(double)
public double getEdgeCrossingPenalty()
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.
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.setEdgeCrossingPenalty(double)
public double getEdgeLabelCrossingPenalty()
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_PENALTY_FACTOR_DPKEY
.
Use EdgeLabelConsiderationEnabled
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.
EdgeRouter.setEdgeLabelConsiderationEnabled(boolean)
,
setEdgeLabelCrossingPenalty(double)
public double getEdgeLengthPenalty()
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.setEdgeLengthPenalty(double)
public double getGroupNodeCrossingPenalty()
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.
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.setGroupNodeCrossingPenalty(double)
public double getInvalidEdgeGroupingPenalty()
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_GROUP_ID_DPKEY
or PortConstraintKeys.TARGET_GROUP_ID_DPKEY
key.
The value must be greater than or equal to 0
, otherwise the default value will be assigned.
PortConstraintKeys.SOURCE_GROUP_ID_DPKEY
,
PortConstraintKeys.TARGET_GROUP_ID_DPKEY
,
setInvalidEdgeGroupingPenalty(double)
public double getMinimumEdgeToEdgeDistancePenalty()
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 MinimumEdgeToEdgeDistance
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.
EdgeLayoutDescriptor.setMinimumEdgeToEdgeDistance(double)
,
setMinimumEdgeToEdgeDistancePenalty(double)
public double getMinimumFirstLastSegmentLengthPenalty()
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 MinimumFirstSegmentLength
to set the minimum length of the first segment and MinimumLastSegmentLength
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.
EdgeLayoutDescriptor.setMinimumFirstSegmentLength(double)
,
EdgeLayoutDescriptor.setMinimumLastSegmentLength(double)
,
setMinimumFirstLastSegmentLengthPenalty(double)
public double getMinimumGroupNodeToEdgeDistancePenalty()
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 MinimumNodeToEdgeDistance
to set the minimum distance.
The value must be greater than or equal to 0
, otherwise the default value will be assigned.
EdgeRouter.setMinimumNodeToEdgeDistance(double)
,
setMinimumGroupNodeToEdgeDistancePenalty(double)
public double getMinimumNodeCornerDistancePenalty()
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 MinimumNodeCornerDistance
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.
EdgeLayoutDescriptor.setMinimumNodeCornerDistance(double)
,
setMinimumNodeCornerDistancePenalty(double)
public double getMinimumNodeToEdgeDistancePenalty()
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.
EdgeRouter.setMinimumNodeToEdgeDistance(double)
,
setMinimumNodeToEdgeDistancePenalty(double)
public double getMonotonyViolationPenalty()
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 MonotonicPathRestriction
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.
EdgeLayoutDescriptor.setMonotonicPathRestriction(com.yworks.yfiles.layout.router.MonotonicPathRestriction)
,
setMonotonyViolationPenalty(double)
public double getNodeCrossingPenalty()
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.
setNodeCrossingPenalty(double)
public double getNodeLabelCrossingPenalty()
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_PENALTY_FACTOR_DPKEY
.
Use NodeLabelConsiderationEnabled
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.EdgeRouter.setNodeLabelConsiderationEnabled(boolean)
,
setNodeLabelCrossingPenalty(double)
public double getPartitionGridCellReentrancePenalty()
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.
PartitionGrid
,
setPartitionGridCellReentrancePenalty(double)
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.
PortCandidate
,
PortConstraint
,
setPortViolationPenalty(double)
public double getSingleSideSelfLoopPenalty()
This penalty will make self-loops leave and enter the node at different sides unless they are forced to one side by
PortConstraint
s or PortCandidate
s.
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.
setSingleSideSelfLoopPenalty(double)
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
public void setBendPenalty(double value)
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.1
) can lead to squiggles when the algorithm tries to avoid more expensive restrictions.value
- the penaltygetBendPenalty()
public void setBendsInNodeToEdgeDistancePenalty(double value)
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
MinimumNodeToEdgeDistance
.
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.
MinimumNodeToEdgeDistancePenalty
since they are used for the same feature.value
- the penaltyEdgeRouter.setMinimumNodeToEdgeDistance(double)
,
getBendsInNodeToEdgeDistancePenalty()
public void setEdgeCrossingPenalty(double value)
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.
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.value
- the penaltygetEdgeCrossingPenalty()
public void setEdgeLabelCrossingPenalty(double value)
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_PENALTY_FACTOR_DPKEY
.
Use EdgeLabelConsiderationEnabled
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.
value
- the penaltyEdgeRouter.setEdgeLabelConsiderationEnabled(boolean)
,
getEdgeLabelCrossingPenalty()
public void setEdgeLengthPenalty(double value)
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.value
- the penaltygetEdgeLengthPenalty()
public void setGroupNodeCrossingPenalty(double value)
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.
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.value
- the penaltygetGroupNodeCrossingPenalty()
public void setInvalidEdgeGroupingPenalty(double value)
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_GROUP_ID_DPKEY
or PortConstraintKeys.TARGET_GROUP_ID_DPKEY
key.
The value must be greater than or equal to 0
, otherwise the default value will be assigned.
value
- the penaltyPortConstraintKeys.SOURCE_GROUP_ID_DPKEY
,
PortConstraintKeys.TARGET_GROUP_ID_DPKEY
,
getInvalidEdgeGroupingPenalty()
public void setMinimumEdgeToEdgeDistancePenalty(double value)
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 MinimumEdgeToEdgeDistance
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.
value
- the penaltyEdgeLayoutDescriptor.setMinimumEdgeToEdgeDistance(double)
,
getMinimumEdgeToEdgeDistancePenalty()
public void setMinimumFirstLastSegmentLengthPenalty(double value)
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 MinimumFirstSegmentLength
to set the minimum length of the first segment and MinimumLastSegmentLength
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.
value
- the penaltyEdgeLayoutDescriptor.setMinimumFirstSegmentLength(double)
,
EdgeLayoutDescriptor.setMinimumLastSegmentLength(double)
,
getMinimumFirstLastSegmentLengthPenalty()
public void setMinimumGroupNodeToEdgeDistancePenalty(double value)
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 MinimumNodeToEdgeDistance
to set the minimum distance.
The value must be greater than or equal to 0
, otherwise the default value will be assigned.
value
- the penaltyEdgeRouter.setMinimumNodeToEdgeDistance(double)
,
getMinimumGroupNodeToEdgeDistancePenalty()
public void setMinimumNodeCornerDistancePenalty(double value)
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 MinimumNodeCornerDistance
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.
value
- the penaltyEdgeLayoutDescriptor.setMinimumNodeCornerDistance(double)
,
getMinimumNodeCornerDistancePenalty()
public void setMinimumNodeToEdgeDistancePenalty(double value)
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.
value
- the penaltyEdgeRouter.setMinimumNodeToEdgeDistance(double)
,
getMinimumNodeToEdgeDistancePenalty()
public void setMonotonyViolationPenalty(double value)
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 MonotonicPathRestriction
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.
value
- the penaltyEdgeLayoutDescriptor.setMonotonicPathRestriction(com.yworks.yfiles.layout.router.MonotonicPathRestriction)
,
getMonotonyViolationPenalty()
public void setNodeCrossingPenalty(double value)
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.
value
- the penaltygetNodeCrossingPenalty()
public void setNodeLabelCrossingPenalty(double value)
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_PENALTY_FACTOR_DPKEY
.
Use NodeLabelConsiderationEnabled
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.value
- the penaltyEdgeRouter.setNodeLabelConsiderationEnabled(boolean)
,
getNodeLabelCrossingPenalty()
public void setPartitionGridCellReentrancePenalty(double value)
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.
value
- the penaltyPartitionGrid
,
getPartitionGridCellReentrancePenalty()
public void setPortViolationPenalty(double value)
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.
value
- the penaltyPortCandidate
,
PortConstraint
,
getPortViolationPenalty()
public void setSingleSideSelfLoopPenalty(double value)
This penalty will make self-loops leave and enter the node at different sides unless they are forced to one side by
PortConstraint
s or PortCandidate
s.
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.
value
- the penaltygetSingleSideSelfLoopPenalty()