Class DestinationBush

  • All Implemented Interfaces:
    Comparable<IdAble>, Bush, IdAble

    public class DestinationBush
    extends RootedLabelledBush
    A destination bush is an (inverted) acyclic directed graph rooted at many origins going to a single destination representing all implicit paths along a network to the given destination. Demand on the bush is placed along its root node(s) which is then split across the graph by (bush specific) splitting rates that reside on each edge. The sum of the edge splitting rates originating from a vertex must always sum to 1.
    Author:
    markr
    • Field Detail

      • destination

        protected final CentroidVertex destination
        Destination of this bush
    • Constructor Detail

      • DestinationBush

        public DestinationBush​(IdGroupingToken idToken,
                               CentroidVertex destination,
                               long maxSubGraphEdgeSegments)
        Constructor
        Parameters:
        idToken - the token to base the id generation on
        destination - destination of the bush
        maxSubGraphEdgeSegments - The maximum number of edge segments the bush can at most register given the parent network it is a subset of
      • DestinationBush

        public DestinationBush​(DestinationBush bush,
                               boolean deepCopy)
        Copy constructor
        Parameters:
        bush - to copy
        deepCopy - when true, create a eep copy, shallow copy otherwise
    • Method Detail

      • computeMinMaxShortestPaths

        public MinMaxPathResult computeMinMaxShortestPaths​(double[] linkSegmentCosts,
                                                           int totalTransportNetworkVertices)
        Compute the min-max path tree rooted at the destination towards all origins given the provided (network wide) costs. The provided costs are at the network level so should contain all the segments active in the bush
        Specified by:
        computeMinMaxShortestPaths in class RootedLabelledBush
        Parameters:
        linkSegmentCosts - to use
        totalTransportNetworkVertices - number of vertices in overall network needed to be able to construct result per vertex based on id
        Returns:
        minMaxPathResult, null if unable to complete
      • getShortestSearchType

        public ShortestSearchType getShortestSearchType()
        determine the search type supported by the bush based on the underlying dag's construction, i.e., a destination-based dag results in All-To-One, whereas an origin based dag results in One-To-All searches.
        Returns:
        shortest search type compatible with this bush implementation
      • getTopologicalIterator

        public Iterator<DirectedVertex> getTopologicalIterator​(boolean originDestinationDirection)
        Collect an iterator over topologically sorted bush in origin-destination or destination-origin direction. Depending on the derived bush implementation this might require inverting the iteration direction. Hence it is an abstract method here
        Parameters:
        originDestinationDirection - when true, iterator runs topological order from origin towards destinatino, when false, they other way around
        Returns:
        iterator over topologically ordered bush vertices
      • deepClone

        public DestinationBush deepClone()
        An id entity should always support a deep copy, i.e., all "owned" members will be deep copied when a clone of this instance is created via this call. To be used with caution if not called by managed id container related code
        Specified by:
        deepClone in interface Bush
        Specified by:
        deepClone in interface IdAble
        Specified by:
        deepClone in class RootedLabelledBush
        Returns:
        deep copy of entity
      • getDestination

        public CentroidVertex getDestination()
        collect destination of this bush
        Returns:
        destination zone