Class ConjugateShortestPathGeneralised


  • public class ConjugateShortestPathGeneralised
    extends ShortestPathGeneralised
    Conjugate version of shortest path algorithm. The only difference is found in that the original network edge segment costs are now obtained on the turn level, where each conjugate edge segment (turn) collects its cost by means of its incoming original edge segment. Note that for the final turn this means the last edge segemnt's cost is missed which is compensated for at the end In its current form, it assumes a macroscopic network and macroscopic link segments to operate on
    Author:
    markr
    • Field Detail

      • conjugateConnectoidNodes

        protected final ConjugateConnectoidNodes conjugateConnectoidNodes
        needed to track the costs to the centroids on the final original edge segments
    • Constructor Detail

      • ConjugateShortestPathGeneralised

        public ConjugateShortestPathGeneralised​(double[] originalEdgeSegmentCosts,
                                                int numberOfConjugateVertices,
                                                ConjugateConnectoidNodes conjugateConnectoidNodes)
        Constructor for an edge cost based Dijkstra algorithm for finding shortest paths.
        Parameters:
        originalEdgeSegmentCosts - original network (non-conjugate) edge segment costs, both physical and virtual
        numberOfConjugateVertices - number of conjugate vertices
        conjugateConnectoidNodes - conjugate connectoid nodes needed to extract the cost on the last original edge segments to reach the original centroids
    • Method Detail

      • internalExecute

        protected double[] internalExecute​(BiPredicate<Double,​Double> verifyVertex,
                                           Consumer<EdgeSegment> shortestAlternativeEdgeSegmentConsumer)
        Generalised shortest-X search
        Overrides:
        internalExecute in class ShortestPathGeneralised
        Parameters:
        verifyVertex - predicate to test if the new cost to reach vertex is considered shortest compared to existing cost
        shortestAlternativeEdgeSegmentConsumer - process the "shortest" alternative edge segment when verified by the predicate
        Returns:
        found shortest costs for vertices, where the most recent found "shortest" cost is the one available in the array
      • getEdgeSegmentCost

        protected Double getEdgeSegmentCost​(EdgeSegment edgeSegment)
        For a conjugate network we obtain the conjugate edge segment cost by means of the incoming original edge segment of the turn, i.e., conjugate edge segment
        Overrides:
        getEdgeSegmentCost in class ShortestPathGeneralised
        Parameters:
        edgeSegment - to use
        Returns:
        cost of traversing edge segment