Remarks
An extension contains the callback method calculateCosts that is used by the path searching algorithm to calculate the costs for the next possible steps (i.e., entering the next partition cell) and to decide when the target is reached.
The path search algorithm uses the callbacks in the following order:
See Also
Members
Constructors
Creates a new instance of PathSearchExtension.
Properties
Gets the configuration used for the path search.
Property Value
Gets the current context of the path search.
Property Value
Methods
Appends additional start entrances for the path search of the current edge to the given list of all previously generated entrances.
Parameters
- allStartEntrances: IList<CellEntrance>
- a list of all previously generated entrances
Calculates the costs for entering the given PartitionCell via the given enter OrthogonalInterval.
The given EdgeCellInfo describes how the partition cell that has been entered by the current entrance would be traversed if this enter interval to the neighboring cell would be chosen.
The maxAllowedCosts describe the maximum costs that entering the neighboring cell via the given enter interval may induce. If the maximum cost is exceeded, calculations that may further increase its cost may be skipped because this interval won't be chosen anyway.
This implementation doesn't add any costs. It may be overridden to add costs, e.g., if entering through the given interval would create a bend.
Parameters
- currentEntrance: CellEntrance
- The entrance that was used for entering the current cell
- enteredCell: PartitionCell
- The neighboring cell that shall be entered
- enterInterval: OrthogonalInterval
- The interval that shall be used for entering the neighboring cell
- edgeCellInfo: EdgeCellInfo
- The information about how the current cell would be traversed if the neighboring cell would be entered by this enter interval
- maxAllowedCosts: number
- The maximum allowed costs for this enter interval
Return Value
- number
- The costs for entering the neighboring cell via the enter interval
Calculates the heuristic costs for the given CellEntrance that describes the minimal costs that will arise to finish the path if the given cell entrance is used as the next step.
After evaluating the costs for each enter interval to a neighboring cell, this method is called for each of the resulting CellEntrances.
This implementation doesn't add any costs. It may be overridden to add some heuristic costs, e.g., if the edge would have to bend to reach the target node from the given CellEntrance.
Parameters
- entrance: CellEntrance
- the entrance to calculate the heuristic costs for the rest of the path
Return Value
- number
- the minimal costs that will arise to finish the path if the given cell entrance is used as the next step
Returns the cost for starting the path in the given entrance.
This method is called for each start entrance of the current edge.
The current implementation doesn't add any costs for the given CellEntrance. It may be overridden to make start entrances with less specific intervals more expensive. For example, intervals that allow more than just the LayoutPortCandidate location to connect to the source node become more expensive.
Parameters
- startEntrance: CellEntrance
- the start entrance for which the cost is calculated
Return Value
- number
- the cost for starting the path in the given entrance
This callback notifies the extension when the path search for the current edge is canceled. Then, the path search will proceed with altering the penalties of the current edge and reinitializing it again.
This implementation does nothing. It may be overridden to reset some edge specific information, e.g., removing previously added listeners.
See Also
Handles the cancellation of the path search for the current PathSearchRequest.
This callback notifies the extension when the path search for the current request is canceled. In case that not all requests of an edge are successful, then also the path search for that edge will be canceled.
This implementation does nothing. It may be overridden to process or reset PathSearchRequest-specific data like e.g., previously registered listeners.
See Also
Cleans up the extension from the path searches with the current configuration and context.
This callback notifies the extension when enough paths are found for the current edge. After that, the path search either proceeds with initializing the next current edge in the context's edge list or calls finalizeEdges if all edges in this list have been handled.
This implementation does nothing. It may be overridden to add/reset some edge-specific information, e.g., removing previously added listeners or adding new start entrances.
See Also
See Also
API
- edges
After finding a valid target entrance and creating a PathSearchResult, the extension is notified of the found path.
If the path search is configured to calculate several possible paths for an edge, the path search proceeds with choosing another unhandled CellEntrance.
This implementation does nothing. It may be overridden to collect some information about the given path that may influence the path search of later edges.
Parameters
- path: PathSearchResult
- the path found for the current edge in the context
See Also
API
- currentEdge
Initializes this extension for path searches using the given configuration.
configuration in property configuration. It may be overridden to initialize this extension with other data that is needed for the whole path search algorithm.Parameters
- configuration: PathSearchConfiguration
- the configuration to use for the following path searches
Initializes this extension with the current edge set in context.
This method is called for each edge of the context. Each call will be balanced by a call to either finalizeCurrentEdge or cancelCurrentEdge.
It may be overridden to initialize/reset the settings for the current edge (e.g. minimum distances).
See Also
API
- currentEdge
Initializes this extension with the current PathSearchRequest set in the given context.
This method is called for each request of the context's currentEdge. Each call will be balanced by a call to either finalizePath or cancelCurrentPathRequest.
This method may be overridden to modify settings and data that should be individual for each PathSearchRequest.
See Also
Initializes this extension with the context that contains the list of edges for which paths are calculated.
This method may be called several times during a path search. Each call will be balanced by calls to finalizeEdges. The default implementation stores the given context in property context.
It may be overridden to initialize/reset the settings for the routed edges (e.g. minimum distances).
Parameters
- context: PathSearchContext
- the context containing the list of edges for which paths shall be found
See Also
API
- edges
Determines whether or not this extension considers the given CellEntrance as a valid target entrance, that is, the path may end with the given entrance.
Each time a CellEntrance is chosen as the next step, all registered extensions are asked if this entrance is a valid target entrance. Only if none of the extensions returns false, a PathSearchResult is created.
This implementation accepts all CellEntrances as valid targets. It may be overridden to only activate the target if the route fulfills a certain condition.
Parameters
- entrance: CellEntrance
- the entrance to decide if it is a valid target entrance
Return Value
- boolean
trueif the path may end with this entrance,falseotherwise