public class EdgeRouter extends AbstractLayoutStage
routing style
in which, between
horizontal and vertical segments, additional segments with other slopes are inserted.
During the routing process, the positions of the nodes are considered to be fixed and the routing algorithm will not modify their locations or their sizes in any way.
The edge routing algorithm can be applied wherever it is needed to route the edges as polyline or orthogonal segments without crossing any nodes, while keeping the positions of the nodes in the diagram fixed. Some potential applications include electric circuit design, floor planning and navigation maps.
Sample output of the edge routing algorithm with default settings Sample output of the edge routing algorithm with polyline routing and grouped edges Sample output of the edge routing algorithm with polyline routing and group nodes
IPartition
which divides the area of the graph area into several PartitionCell
s.IPartition
using PathSearch
.ChannelBasedPathRouting
.
polyline routing
is enabled).
The first two steps are customizable. IGraphPartitionExtension
s are able to influence how the IPartition
is created. They add PartitionCell
s and/or mark them for adding costs later in the process. The currently used partition extensions
can be dropped or extended by custom implementations.
For example, the extension 'Node Partition' adds a PartitionCell
to the IPartition
for each node and
marks it as belonging to a node. During PathSearch
, the extension 'Node Crossing' recognizes these
PartitionCell
s and adds costs that penalizes crossing a node. The edge will be routed around the nodes.
PathSearchExtension
s influence the PathSearch
by adding costs for traversing PartitionCell
s or
narrowing their intervals to allow a less expensive traversal of a PartitionCell
. The currently used partition extensions
can be dropped or extended by custom implementations.
Using EdgeLayoutDescriptor
s, it is possible to add individual layout settings like routing styles to edges. They
are registered with the graph with key EDGE_LAYOUT_DESCRIPTOR_DPKEY
. If no descriptor is provided for an edge,
a default edge layout descriptor
is used as fallback value.
The routing algorithm supports two approaches to connect edges on a specific side or even on an exact location to a
node. PortConstraint
s define a single constraint for the ports of an edge. To realize
more complex port restrictions, several PortCandidate
s or PortCandidateSet
s can
be assigned to edges or nodes. If an edge with registered PortCandidate
s connects to nodes with
PortCandidateSet
s, the edge router will try to match both collections in order to
find an appropriate port. In case there is no matching port candidate, a PortCandidate
specified for the edge is
preferred. Since their simultaneous existence at the same node may be ambiguous, it is not recommended to use a
combination of PortConstraint
s and PortCandidate
s in the same diagram.
Edges can be grouped so that they share common segments at the beginning or end of their routes. Although a graph may
contain source and target grouped edges, an edge can only either be part of a source or a target group. Edge groups are
specified using IDataProvider
s that provide the same ID object for all edges in the same group. Those
IDataProvider
s are registered with the graph with key PortConstraintKeys.SOURCE_GROUP_ID_DPKEY
for
source groups or key PortConstraintKeys.TARGET_GROUP_ID_DPKEY
for target groups.
Modifier and Type | Field and Description |
---|---|
static EdgeDpKey<EdgeLayoutDescriptor> |
EDGE_LAYOUT_DESCRIPTOR_DPKEY
A
DataProvider key for specifying individual edge layout information
If this IDataProvider does not contain an EdgeLayoutDescriptor for an edge, then the layout algorithm
will use the default descriptor . |
static ILabelLayoutDpKey<Double> |
LABEL_CROSSING_PENALTY_FACTOR_DPKEY
A
DataProvider key for weighting the costs for crossing each label individually
If the factor for a label is 0 then it is allowed to cross it. |
Constructor and Description |
---|
EdgeRouter()
Creates a new
EdgeRouter instance with an optional
core layout algorithm . |
EdgeRouter(ILayoutAlgorithm core)
Creates a new
EdgeRouter instance with an optional
core layout algorithm . |
Modifier and Type | Method and Description |
---|---|
void |
applyLayout(LayoutGraph graph)
Performs the routing of the edges of the input graph.
|
protected void |
checkNodeSize(LayoutGraph g)
Checks the sizes of the nodes to be non-zero.
|
protected void |
cleanUpGraphPartition(GraphPartition partition)
Removes all registered
IGraphPartitionExtension s from a given GraphPartition instance. |
protected void |
configureGraphPartition(GraphPartition partition)
Adds all registered
IGraphPartitionExtension s instances to a given GraphPartition instance. |
protected void |
configurePathSearch(PathSearch pathSearch)
Adds all registered
PathSearchExtension s to a given PathSearch instance. |
protected PathSearchConfiguration |
createConfiguration(LayoutGraph graph,
GroupingSupport grouping)
Creates a
PathSearchConfiguration that is used during the path searching process. |
protected Comparator<Object> |
createDefaultEdgeOrderComparator(LayoutGraph graph,
PathSearchConfiguration configuration)
Creates a default
Comparator instance to determine the order of the edges according to which they will be
routed. |
protected GraphPartition |
createGraphPartition(IObstaclePartition decomposition)
Creates a
GraphPartition instance that divides the area of the graph into several rectangles. |
protected DynamicObstacleDecomposition |
createObstacleDecomposition()
Creates a
DynamicObstacleDecomposition that is used by the GraphPartition to divide the graph area in
rectangles. |
protected ChannelBasedPathRouting |
createPathRouting()
Creates a
ChannelBasedPathRouting instance that routes the edges using pre-calculated Path objects. |
protected PathSearch |
createPathSearch()
Creates a
PathSearch instance that finds the paths of the edges through the GraphPartition . |
protected PathSearchContext |
createPathSearchContext(PathSearch pathSearch,
PathSearchConfiguration configuration)
Creates a
PathSearchContext that provides context information for the path searching algorithm. |
Object |
getAffectedEdgesDpKey()
Gets the
IDataProvider key to look up the selection state of the edges. |
Object |
getAffectedNodesDpKey()
Gets the
IDataProvider key to look up the selection state of the nodes. |
EdgeLayoutDescriptor |
getDefaultEdgeLayoutDescriptor()
Gets the
EdgeLayoutDescriptor instance used for all those edges that do not have a specific edge layout
descriptor assigned. |
Comparator<Object> |
getEdgeComparator()
Gets a custom
Comparator to define the processing order of the edges. |
protected EdgeLayoutDescriptor |
getEdgeLayoutDescriptor(Edge edge)
Returns the
EdgeLayoutDescriptor instance for a given edge that is provided by a IDataProvider which is
registered with the graph with key EDGE_LAYOUT_DESCRIPTOR_DPKEY . |
Grid |
getGrid()
Gets the
Grid instance on which the routing algorithm places the orthogonal segments. |
long |
getMaximumDuration()
Gets the time limit (in milliseconds) set for the edge routing algorithm.
|
double |
getMaximumPolylineSegmentRatio()
Gets the maximum ratio between the horizontal/vertical part of a segment and the (non-orthogonal) polyline part.
|
double |
getMinimumNodeToEdgeDistance()
Gets the minimum distance between edges and node bounds.
|
GraphPartition |
getPartition()
Gets the
GraphPartition instance used during the routing process. |
double |
getPreferredPolylineSegmentLength()
Gets the preferred length of (non-orthogonal) polyline segments.
|
List<Object> |
getRegisteredPartitionExtensions()
Gets a list of all registered
IGraphPartitionExtension s. |
List<Object> |
getRegisteredPathSearchExtensions()
Gets a list of all registered
PathSearchExtension s. |
Scope |
getScope()
Gets a (sub-)set of edges that shall be routed.
|
protected boolean |
isAffected(Edge edge,
Graph graph)
Returns whether or not a given edge is selected.
|
boolean |
isEdgeLabelConsiderationEnabled()
Gets whether or not the routing algorithm considers as obstacles the edge labels that do not belong to the (sub-)set of
edges to be routed when calculating the edge routes.
|
boolean |
isIgnoringInnerNodeLabelsEnabled()
Gets whether or not this routing algorithm ignores node labels that are inside the bounds of their owner as obstacles
for edge routes.
|
boolean |
isNodeLabelConsiderationEnabled()
Gets whether or not the routing algorithm considers the labels of the nodes as obstacles when calculating the edge
routes to avoid overlaps.
|
boolean |
isPolylineRoutingEnabled()
Gets whether or not the routing algorithm will route the edges of the graph with (non-orthogonal) polyline segments.
|
boolean |
isReroutingEnabled()
Gets whether or not the routing algorithm uses an additional step to reroute the edges that are considered to have the
worst paths.
|
void |
setAffectedEdgesDpKey(Object value)
Sets the
IDataProvider key to look up the selection state of the edges. |
void |
setAffectedNodesDpKey(Object value)
Sets the
IDataProvider key to look up the selection state of the nodes. |
void |
setEdgeComparator(Comparator<Object> value)
Sets a custom
Comparator to define the processing order of the edges. |
void |
setEdgeLabelConsiderationEnabled(boolean value)
Sets whether or not the routing algorithm considers as obstacles the edge labels that do not belong to the (sub-)set of
edges to be routed when calculating the edge routes.
|
void |
setGrid(Grid value)
Sets the
Grid instance on which the routing algorithm places the orthogonal segments. |
void |
setIgnoringInnerNodeLabelsEnabled(boolean value)
Sets whether or not this routing algorithm ignores node labels that are inside the bounds of their owner as obstacles
for edge routes.
|
void |
setMaximumDuration(long value)
Sets the time limit (in milliseconds) set for the edge routing algorithm.
|
void |
setMaximumPolylineSegmentRatio(double value)
Sets the maximum ratio between the horizontal/vertical part of a segment and the (non-orthogonal) polyline part.
|
void |
setMinimumNodeToEdgeDistance(double value)
Sets the minimum distance between edges and node bounds.
|
void |
setNodeLabelConsiderationEnabled(boolean value)
Sets whether or not the routing algorithm considers the labels of the nodes as obstacles when calculating the edge
routes to avoid overlaps.
|
void |
setPolylineRoutingEnabled(boolean value)
Sets whether or not the routing algorithm will route the edges of the graph with (non-orthogonal) polyline segments.
|
void |
setPreferredPolylineSegmentLength(double value)
Sets the preferred length of (non-orthogonal) polyline segments.
|
void |
setReroutingEnabled(boolean value)
Sets whether or not the routing algorithm uses an additional step to reroute the edges that are considered to have the
worst paths.
|
void |
setScope(Scope value)
Sets a (sub-)set of edges that shall be routed.
|
applyLayoutCore, getCoreLayout, setCoreLayout
public static final EdgeDpKey<EdgeLayoutDescriptor> EDGE_LAYOUT_DESCRIPTOR_DPKEY
DataProvider
key for specifying individual edge layout information
If this IDataProvider
does not contain an EdgeLayoutDescriptor
for an edge, then the layout algorithm
will use the default descriptor
.
getDefaultEdgeLayoutDescriptor()
public static final ILabelLayoutDpKey<Double> LABEL_CROSSING_PENALTY_FACTOR_DPKEY
DataProvider
key for weighting the costs for crossing each label individually
If the factor for a label is 0
then it is allowed to cross it. Very important labels should get a high factor.
This factor is multiplied by the basic penalty arising when an edge must cross a node label
or an edge label
in order
to determine the final costs arising when this label is crossed.
public EdgeRouter()
EdgeRouter
instance with an optional
core layout algorithm
.public EdgeRouter(ILayoutAlgorithm core)
EdgeRouter
instance with an optional
core layout algorithm
.core
- The core layout algorithm.public void applyLayout(LayoutGraph graph)
This method also prepares the graph for the edge routing process.
applyLayout
in interface ILayoutAlgorithm
applyLayout
in class AbstractLayoutStage
graph
- the input graphprotected void checkNodeSize(LayoutGraph g)
g
- The graph to check.protected void cleanUpGraphPartition(GraphPartition partition)
IGraphPartitionExtension
s from a given GraphPartition
instance.
This method is called by applyLayout(LayoutGraph)
after the edge routes are calculated. It may be overridden in
order to provide a custom implementation for cleaning up a GraphPartition
instance.
partition
- the given GraphPartition
instanceconfigureGraphPartition(GraphPartition)
,
getRegisteredPartitionExtensions()
protected void configureGraphPartition(GraphPartition partition)
IGraphPartitionExtension
s instances to a given GraphPartition
instance.
This method is called by applyLayout(LayoutGraph)
before the edge routes are calculated. It may be overridden
in order to adjust the configuration of the GraphPartition
instance.
partition
- the given GraphPartition
instancegetRegisteredPartitionExtensions()
,
cleanUpGraphPartition(GraphPartition)
protected void configurePathSearch(PathSearch pathSearch)
PathSearchExtension
s to a given PathSearch
instance.
This method is called by applyLayout(LayoutGraph)
before the edge routes are calculated. It may be overridden
in order to adjust the configuration of a PathSearch
instance.
pathSearch
- a PathSearch
instancecreatePathSearch()
,
getRegisteredPathSearchExtensions()
protected PathSearchConfiguration createConfiguration(LayoutGraph graph, GroupingSupport grouping)
PathSearchConfiguration
that is used during the path searching process.
This method is called by applyLayout(LayoutGraph)
before the edge routes are calculated. It may be overridden
in order to create a new PathSearchConfiguration
object with custom configuration.
graph
- the input graphgrouping
- the grouping structure of the graphPathSearchConfiguration
instanceprotected Comparator<Object> createDefaultEdgeOrderComparator(LayoutGraph graph, PathSearchConfiguration configuration)
Comparator
instance to determine the order of the edges according to which they will be
routed.
This method is called by applyLayout(LayoutGraph)
before the edge routes are calculated. It may be overridden
in order to create a new Comparator
object with a custom configuration.
By default, this method returns an instance of the default implementation.
graph
- the input graphconfiguration
- the given configuration for the path searching processComparator
instanceprotected GraphPartition createGraphPartition(IObstaclePartition decomposition)
GraphPartition
instance that divides the area of the graph into several rectangles.
This implementation creates a GraphPartition
using the current IObstaclePartition
instance.
This method is called by applyLayout(LayoutGraph)
before the edge routes are calculated. It may be overridden
in order to create a new GraphPartition
object with a custom configuration.
decomposition
- the current IObstaclePartition
GraphPartition
instanceconfigureGraphPartition(GraphPartition)
,
getRegisteredPartitionExtensions()
protected DynamicObstacleDecomposition createObstacleDecomposition()
DynamicObstacleDecomposition
that is used by the GraphPartition
to divide the graph area in
rectangles.
This method is called by applyLayout(LayoutGraph)
before the edge routes are calculated. It may be overridden
in order to create a new DynamicObstacleDecomposition
object with custom configuration.
DynamicObstacleDecomposition
instancecreateGraphPartition(IObstaclePartition)
protected ChannelBasedPathRouting createPathRouting()
ChannelBasedPathRouting
instance that routes the edges using pre-calculated Path
objects.
This method is called by applyLayout(LayoutGraph)
before the edge routes are calculated. It may be overridden
in order to create a new ChannelBasedPathRouting
object with custom configuration.
ChannelBasedPathRouting
instanceprotected PathSearch createPathSearch()
PathSearch
instance that finds the paths of the edges through the GraphPartition
.
This method may be overridden in order to create a new PathSearch
object with custom configuration.
PathSearch
instanceconfigurePathSearch(PathSearch)
,
getRegisteredPathSearchExtensions()
protected PathSearchContext createPathSearchContext(PathSearch pathSearch, PathSearchConfiguration configuration)
PathSearchContext
that provides context information for the path searching algorithm.
This method is called by applyLayout(LayoutGraph)
before the edge routes are calculated. It may be overridden
in order to create a new PathSearchContext
object with custom configuration.
pathSearch
- a given PathSearch
instanceconfiguration
- a given configuration for the path searching processPathSearchContext
instancepublic Object getAffectedEdgesDpKey()
IDataProvider
key to look up the selection state of the edges.
If the scope
is set to
Scope.ROUTE_AFFECTED_EDGES
, only the selected edges will be routed, while all other edges will be considered
to have fixed routes.
IllegalArgumentException
- if the specified IDataProvider
key is null
LayoutKeys.AFFECTED_EDGES_DPKEY
IDataProvider
key for the edge selectionsetScope(Scope)
,
setAffectedEdgesDpKey(Object)
public Object getAffectedNodesDpKey()
IDataProvider
key to look up the selection state of the nodes.
If the scope
is set to
Scope.ROUTE_EDGES_AT_AFFECTED_NODES
, only the edges that are incident to selected nodes will be routed,
while all other edges will be considered to have fixed routes.
IllegalArgumentException
- if the specified IDataProvider
key is null
LayoutKeys.AFFECTED_NODES_DPKEY
IDataProvider
key for the node selectionsetScope(Scope)
,
setAffectedNodesDpKey(Object)
public EdgeLayoutDescriptor getDefaultEdgeLayoutDescriptor()
EdgeLayoutDescriptor
instance used for all those edges that do not have a specific edge layout
descriptor assigned.EdgeLayoutDescriptor
EDGE_LAYOUT_DESCRIPTOR_DPKEY
public Comparator<Object> getEdgeComparator()
Comparator
to define the processing order of the edges.Comparator
. The comparator returned by EdgeComparator
.Comparator
instancecreateDefaultEdgeOrderComparator(LayoutGraph, PathSearchConfiguration)
,
setEdgeComparator(Comparator)
protected EdgeLayoutDescriptor getEdgeLayoutDescriptor(Edge edge)
EdgeLayoutDescriptor
instance for a given edge that is provided by a IDataProvider
which is
registered with the graph with key EDGE_LAYOUT_DESCRIPTOR_DPKEY
.
For all those edges that do not have a specific layout descriptor assigned, the default layout descriptor returned by DefaultEdgeLayoutDescriptor
will be assigned.
This method may be overridden in order to create an EdgeLayoutDescriptor
with custom configuration.
edge
- the given edgeEdgeLayoutDescriptor
instance for a given edgegetDefaultEdgeLayoutDescriptor()
,
EDGE_LAYOUT_DESCRIPTOR_DPKEY
public Grid getGrid()
Grid
instance on which the routing algorithm places the orthogonal segments.null
. No grid is specified.Grid
instancesetGrid(Grid)
public long getMaximumDuration()
The maximum duration has to be greater than or equal to 0
.
IllegalArgumentException
- if the maximum duration is negativeLong.MAX_VALUE
. The edge routing algorithm runs unrestricted.setMaximumDuration(long)
public double getMaximumPolylineSegmentRatio()
When polyline segments are added to an edge path, corners between horizontal and vertical segments are cut and replaced
by the new segment. This ratio describes the cutting points on a segment. If it is zero, the route stays orthogonal. The
value cannot be larger than 0.5
because there may be another polyline segment at the other side of the segment.
For long orthogonal segments the length of the polyline segment is determined by the value returned by
PreferredPolylineSegmentLength
.
The maximum polyline segment ratio must be between 0
and 0.5
.
IllegalArgumentException
- if the maximum segment length is negative or greater than 0.5
setMaximumPolylineSegmentRatio(double)
public double getMinimumNodeToEdgeDistance()
The minimum distance should have a non-negative value.
IllegalArgumentException
- if the minimum node-to-edge distance is negativePenaltySettings.getMinimumNodeToEdgeDistancePenalty()
,
setMinimumNodeToEdgeDistance(double)
public GraphPartition getPartition()
GraphPartition
instance used during the routing process.null
will be returned.GraphPartition
instancepublic double getPreferredPolylineSegmentLength()
If there is not enough space to use this preferred length, polyline segments may also be shorter.
The preferred length of (non-orthogonal) polyline segments has to be greater than or equal to 0
.
IllegalArgumentException
- if the preferred polyline segment length is negativepolyline routing
is enabled.getMaximumPolylineSegmentRatio()
,
setPreferredPolylineSegmentLength(double)
public List<Object> getRegisteredPartitionExtensions()
IGraphPartitionExtension
s.
IGraphPartitionExtension
s can be added to a GraphPartition
in order to create new
Obstacle
s or can be removed from a GraphPartition
instance.
By default, the following IGraphPartitionExtension
s are registered with a given GraphPartition
instance:
IGraphPartitionExtension
screateGraphPartition(IObstaclePartition)
,
configureGraphPartition(GraphPartition)
public List<Object> getRegisteredPathSearchExtensions()
PathSearchExtension
s.
PathSearchExtension
s can be added to a PathSearch
instance in order to influence the path searching
process or can be removed from a PathSearch
instance.
By default, the following PathSearchExtension
s are registered with a PathSearch
instance:
PathSearchExtension
screatePathSearch()
,
configurePathSearch(PathSearch)
public Scope getScope()
IllegalArgumentException
- if the given scope is unknownScope.ROUTE_ALL_EDGES
getAffectedEdgesDpKey()
,
setScope(Scope)
protected boolean isAffected(Edge edge, Graph graph)
If all the edges of the graph will be routed by EdgeRouter
, i.e., the scope
is set to
Scope.ROUTE_ALL_EDGES
, this utility method returns true
for all edges.
This method may be overridden in order to determine differently whether or not a given edge is considered to be selected.
edge
- the given edgegraph
- the input graphtrue
if the given edge is selected, false
otherwisepublic boolean isEdgeLabelConsiderationEnabled()
Scope
is set to Scope.ROUTE_AFFECTED_EDGES
and a IDataProvider
instance with the key AffectedEdgesDpKey
is registered with the graph.false
. Edge labels are not considered.true
if edge labels are considered, false
otherwisesetScope(Scope)
,
setAffectedEdgesDpKey(Object)
,
PenaltySettings.getNodeLabelCrossingPenalty()
,
setEdgeLabelConsiderationEnabled(boolean)
public boolean isIgnoringInnerNodeLabelsEnabled()
considered
and is
especially useful in order to ignore inner node labels of group nodes.false
. Node labels that are inside the bounds of their owner are not ignored.true
if the routing algorithm ignores inner node labels, false
otherwiseisNodeLabelConsiderationEnabled()
,
PenaltySettings.getNodeLabelCrossingPenalty()
,
LABEL_CROSSING_PENALTY_FACTOR_DPKEY
,
setIgnoringInnerNodeLabelsEnabled(boolean)
public boolean isNodeLabelConsiderationEnabled()
Scope
is set to Scope.ROUTE_EDGES_AT_AFFECTED_NODES
and a IDataProvider
instance with the key AffectedNodesDpKey
is registered with the graph.false
. Node labels are not considered.true
if the node labels are considered, false
otherwisePenaltySettings.getNodeLabelCrossingPenalty()
,
setNodeLabelConsiderationEnabled(boolean)
public boolean isPolylineRoutingEnabled()
false
. The polyline edge routing is disabled.true
if the routing algorithm creates (non-orthogonal) polyline segments, false
otherwisegetPreferredPolylineSegmentLength()
,
getMaximumPolylineSegmentRatio()
,
setPolylineRoutingEnabled(boolean)
public boolean isReroutingEnabled()
maximum duration
has not been exceeded
yet.false
. The rerouting step will not be performed.true
if the rerouting step will be performed, false
otherwisesetReroutingEnabled(boolean)
public void setAffectedEdgesDpKey(Object value)
IDataProvider
key to look up the selection state of the edges.
If the scope
is set to
Scope.ROUTE_AFFECTED_EDGES
, only the selected edges will be routed, while all other edges will be considered
to have fixed routes.
IllegalArgumentException
- if the specified IDataProvider
key is null
LayoutKeys.AFFECTED_EDGES_DPKEY
value
- the IDataProvider
key for the edge selectionsetScope(Scope)
,
getAffectedEdgesDpKey()
public void setAffectedNodesDpKey(Object value)
IDataProvider
key to look up the selection state of the nodes.
If the scope
is set to
Scope.ROUTE_EDGES_AT_AFFECTED_NODES
, only the edges that are incident to selected nodes will be routed,
while all other edges will be considered to have fixed routes.
IllegalArgumentException
- if the specified IDataProvider
key is null
LayoutKeys.AFFECTED_NODES_DPKEY
value
- the IDataProvider
key for the node selectionsetScope(Scope)
,
getAffectedNodesDpKey()
public void setEdgeComparator(Comparator<Object> value)
Comparator
to define the processing order of the edges.Comparator
. The comparator returned by EdgeComparator
.value
- the current Comparator
instancecreateDefaultEdgeOrderComparator(LayoutGraph, PathSearchConfiguration)
,
getEdgeComparator()
public void setEdgeLabelConsiderationEnabled(boolean value)
Scope
is set to Scope.ROUTE_AFFECTED_EDGES
and a IDataProvider
instance with the key AffectedEdgesDpKey
is registered with the graph.false
. Edge labels are not considered.value
- true
if edge labels are considered, false
otherwisesetScope(Scope)
,
setAffectedEdgesDpKey(Object)
,
PenaltySettings.getNodeLabelCrossingPenalty()
,
isEdgeLabelConsiderationEnabled()
public void setGrid(Grid value)
Grid
instance on which the routing algorithm places the orthogonal segments.public void setIgnoringInnerNodeLabelsEnabled(boolean value)
considered
and is
especially useful in order to ignore inner node labels of group nodes.false
. Node labels that are inside the bounds of their owner are not ignored.value
- true
if the routing algorithm ignores inner node labels, false
otherwiseisNodeLabelConsiderationEnabled()
,
PenaltySettings.getNodeLabelCrossingPenalty()
,
LABEL_CROSSING_PENALTY_FACTOR_DPKEY
,
isIgnoringInnerNodeLabelsEnabled()
public void setMaximumDuration(long value)
The maximum duration has to be greater than or equal to 0
.
IllegalArgumentException
- if the maximum duration is negativeLong.MAX_VALUE
. The edge routing algorithm runs unrestricted.value
- a non-negative integer valuegetMaximumDuration()
public void setMaximumPolylineSegmentRatio(double value)
When polyline segments are added to an edge path, corners between horizontal and vertical segments are cut and replaced
by the new segment. This ratio describes the cutting points on a segment. If it is zero, the route stays orthogonal. The
value cannot be larger than 0.5
because there may be another polyline segment at the other side of the segment.
For long orthogonal segments the length of the polyline segment is determined by the value returned by
PreferredPolylineSegmentLength
.
The maximum polyline segment ratio must be between 0
and 0.5
.
IllegalArgumentException
- if the maximum segment length is negative or greater than 0.5
value
- the maximum polyline segment ratiogetMaximumPolylineSegmentRatio()
public void setMinimumNodeToEdgeDistance(double value)
The minimum distance should have a non-negative value.
IllegalArgumentException
- if the minimum node-to-edge distance is negativevalue
- the non-negative minimum distancePenaltySettings.getMinimumNodeToEdgeDistancePenalty()
,
getMinimumNodeToEdgeDistance()
public void setNodeLabelConsiderationEnabled(boolean value)
Scope
is set to Scope.ROUTE_EDGES_AT_AFFECTED_NODES
and a IDataProvider
instance with the key AffectedNodesDpKey
is registered with the graph.false
. Node labels are not considered.value
- true
if the node labels are considered, false
otherwisePenaltySettings.getNodeLabelCrossingPenalty()
,
isNodeLabelConsiderationEnabled()
public void setPolylineRoutingEnabled(boolean value)
false
. The polyline edge routing is disabled.value
- true
if the routing algorithm creates (non-orthogonal) polyline segments, false
otherwisegetPreferredPolylineSegmentLength()
,
getMaximumPolylineSegmentRatio()
,
isPolylineRoutingEnabled()
public void setPreferredPolylineSegmentLength(double value)
If there is not enough space to use this preferred length, polyline segments may also be shorter.
The preferred length of (non-orthogonal) polyline segments has to be greater than or equal to 0
.
IllegalArgumentException
- if the preferred polyline segment length is negativepolyline routing
is enabled.value
- the preferred length of (non-orthogonal) polyline segmentsgetMaximumPolylineSegmentRatio()
,
getPreferredPolylineSegmentLength()
public void setReroutingEnabled(boolean value)
maximum duration
has not been exceeded
yet.false
. The rerouting step will not be performed.value
- true
if the rerouting step will be performed, false
otherwiseisReroutingEnabled()
public void setScope(Scope value)
IllegalArgumentException
- if the given scope is unknownScope.ROUTE_ALL_EDGES
value
- one of the default scope valuesgetAffectedEdgesDpKey()
,
getScope()