This class routes edges using their pre-calculated EdgeRouterPath information.
Remarks
The concept of this algorithm is to bundle edge segments into so-called Channels and route each Channel individually.
This class is initialized using initialize which must have been called before the edges are routed.
After a ChannelBasedPathRouting instance is no longer in use, the Channel information and the reference to the configuration must be reset using method cleanUp.
Type Details
- yfiles module
- router-polyline
- yfiles-umd modules
- layout-area, layout-multipage, layout-orthogonal-compact, layout, router-bus, router-polyline
- Legacy UMD name
- yfiles.router.ChannelBasedPathRouting
See Also
Constructors
Creates a new instance of ChannelBasedPathRouting.
Properties
Gets the path search configuration with which the ChannelBasedPathRouting has been initialized.
Methods
Adjusts the location assigned to a segment info in the channel considering the preferred alignment of the segment.
Remarks
Parameters
A map of options to pass to the method.
- channel - Channel
- the channel that contains the segment infos for which the alignment should be considered
See Also
Calculates the locations of the segment infos in the given channel.
Remarks
Preconditions
- The locations of the segments are
in the . They should respect minimum edge to edge distances and grid constraints and must lie in the respective s.
Parameters
A map of options to pass to the method.
- channel - Channel
- the channel that contains the segment infos for which the locations will be calculated
See Also
Resets all channel information and the reference to the configuration.
Remarks
createSegmentInfoComparer
(channels: YList, pathSearchResult: PathSearchResult, configuration: PathSearchConfiguration) : IComparer<any>Creates a comparator for sorting the SegmentInfos in a Channel from left to right (for vertical segments) or top to bottom (for horizontal segments), respectively.
Remarks
Parameters
A map of options to pass to the method.
- channels - YList
- the channels whose segments will be sorted by the comparator
- pathSearchResult - PathSearchResult
- the path search result containing the EdgeInfos with the SegmentInfos for which the comparator will be used
- configuration - PathSearchConfiguration
- the configuration used during this path search
Returns
Initializes this ChannelBasedPathRouting instance for routing paths that have been found with the given configuration.
Remarks
Parameters
A map of options to pass to the method.
- configuration - PathSearchConfiguration
- the configuration used for the following path routing
See Also
Optimizes the order of the segments in the given channel.
Remarks
After the segments in the channel have been sorted using the comparator created by method createSegmentInfoComparer, segments having a common SegmentGroup are replaced by their common representative segment info.
This method further improves the order of the resulting segment info list to make sure that the subsequent location calculation is able to respect the location ranges of the SegmentInfos and, if possible, the minimum edge to edge distances and possible grid constraints for the segments.
Parameters
A map of options to pass to the method.
- channel - Channel
- the channel for which the order of the SegmentInfos is optimized
Routes the given edges.
Remarks
Before calling this method, method initialize must have been called.
As a first step, the SegmentInfos of all edge paths are distributed to Channels. After that, the segments in each of these Channels are sorted and locations are assigned respecting the segments' location ranges by calling the subsequent methods:
Finally, the control points for the paths are calculated.
Parameters
A map of options to pass to the method.
- edges - EdgeList
- the list of edges to be routed
- pathSearchResult - PathSearchResult
- the path search result containing the EdgeRouterPath objects for the edges
Throws
- Exception({ name: 'InvalidOperationError' })
- if the locations are not within the segment's location range
See Also
Sorts the given list of SegmentInfos using the given comparator.
Remarks
Parameters
A map of options to pass to the method.
- segmentInfos - IList<Object>
- the list of SegmentInfos to be sorted
- segmentInfoComparer - IComparer<Object>
- the comparator used for sorting the list of SegmentInfos