Class RootedBush<V extends DirectedVertex,​ES extends EdgeSegment>

  • All Implemented Interfaces:
    Comparable<IdAble>, Bush, IdAble
    Direct Known Subclasses:
    ConjugateDestinationBush, RootedLabelledBush

    public abstract class RootedBush<V extends DirectedVertex,​ES extends EdgeSegment>
    extends Object
    implements Bush
    A rooted bush is an acyclic directed graph comprising of implicit paths along a network. It has a single root which can be any vertex with only outgoing edge segments. while acyclic its direction can be either be in up or downstream direction compared to the super network it is situated on.

    The vertices in the bush represent link segments in the physical network, whereas each edge represents a turn from one link to another. This way each splitting rate uniquely relates to a single turn and all outgoing edges of a vertex represent all turns of a node's incoming link

    Author:
    markr
    • Field Detail

      • originDemandsPcuH

        protected Map<CentroidVertex,​Double> originDemandsPcuH
        the origin demands (PCU/h) of the bush all representing a root (starting point) within the DAG
      • bushGroupingToken

        protected final IdGroupingToken bushGroupingToken
        token for id generation unique within this bush
      • requireTopologicalSortUpdate

        protected boolean requireTopologicalSortUpdate
        track if underlying acyclic graph is modified, if so, an update of the topological sort is required flagged by this member
    • Constructor Detail

      • RootedBush

        public RootedBush​(IdGroupingToken idToken,
                          DirectedVertex rootVertex,
                          boolean inverted,
                          UntypedACyclicSubGraph<V,​ES> dag)
        Constructor
        Parameters:
        idToken - the token to base the id generation on
        rootVertex - the root vertex of the bush which can be the end or starting point depending whether or not direction is inverted
        inverted - when true bush ends at root vertex and all other vertices precede it, when false the root is the starting point and all other vertices succeed it
        dag - to use for the subgraph representation
      • RootedBush

        public RootedBush​(RootedBush<V,​ES> other,
                          boolean deepCopy)
        Copy constructor
        Parameters:
        other - to copy
        deepCopy - when true, create a eep copy, shallow copy otherwise
    • Method Detail

      • addOriginDemandPcuH

        protected void addOriginDemandPcuH​(CentroidVertex originCentroidVertex,
                                           double demandPcuH)
        Track origin demands for bush
        Parameters:
        originCentroidVertex - to set
        demandPcuH - demand to set
      • syncToNetworkFlows

        public abstract void syncToNetworkFlows​(double[] flowAcceptanceFactors)
        Conduct an update of the bush turn flows based on the network flow acceptance factors by conducting a bush DAG loading and updating the turn sending flows from the root, i.e., scale them back with the flow acceptance factor whenever one is encountered.
        Parameters:
        flowAcceptanceFactors - to use
      • computeMinMaxShortestPaths

        public abstract MinMaxPathResult computeMinMaxShortestPaths​(double[] linkSegmentCosts,
                                                                    int totalTransportNetworkVertices)
        Compute the min-max path tree rooted in location depending on underlying dag configuration of derived implementation 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
        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
      • deepClone

        public abstract RootedBush<V,​ES> 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
        Returns:
        deep copy of entity
      • getId

        public long getId()
        Collect id of the entity
        Specified by:
        getId in interface IdAble
        Returns:
        id found
      • getRootVertex

        public V getRootVertex()
        root vertex of the bush
        Returns:
        root vertex of the bush
      • isInverted

        public boolean isInverted()
        Indicates if bush has inverted direction w.r.t. its root
        Returns:
        true when inverted, false otherwise
      • getOriginVertices

        public Set<CentroidVertex> getOriginVertices()
        Origins (with non-zero flow) registered on this bush
        Returns:
        origins on this bush
      • getOriginDemandPcuH

        public Double getOriginDemandPcuH​(CentroidVertex originVertex)
        Get the origin demand for a given origin
        Parameters:
        originVertex - to collect demand for
        Returns:
        demand (if any)
      • getDirectedVertexIterator

        public Iterator<V> getDirectedVertexIterator()
        Collect iterator for all unique directed vertices in the bush
        Returns:
        iterator
      • getRootZoneVertex

        protected abstract CentroidVertex getRootZoneVertex()
        Each rooted bush is expected to have a zone attached to its root vertex, which is to be returned here
        Returns:
        root zone