Class OriginBush

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

    public class OriginBush
    extends RootedLabelledBush
    An origin bush is an acyclic directed graph comprising of implicit paths along a network rooted at a single origin to all destination with non-zero flow. Demand on the bush is placed along its root node 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
    • Constructor Detail

      • OriginBush

        public OriginBush​(IdGroupingToken idToken,
                          CentroidVertex origin,
                          long maxSubGraphEdgeSegments)
        Constructor
        Parameters:
        idToken - the token to base the id generation on
        origin - origin 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
      • OriginBush

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

        public OriginBush​(OriginBush other,
                          boolean deepCopy)
        Copy constructor
        Parameters:
        other - 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 origin and 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 - needed to be able to create primitive array recording the (partial) subgraph backward link segment results (efficiently)
        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 OriginBush 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
      • getOrigin

        public CentroidVertex getOrigin()
        collect origin of this bush
        Returns:
        origin zone
      • addOriginDemandPcuH

        public void addOriginDemandPcuH​(double demandPcuH)
        add origin demand for this origin bush
        Parameters:
        demandPcuH - demand to add
      • getOriginDemandPcuH

        public Double getOriginDemandPcuH()
        Get the origin demand
        Returns:
        demand (if any)