Package org.goplanit.assignment.ltm.sltm
Class DestinationBush
- java.lang.Object
-
- org.goplanit.assignment.ltm.sltm.RootedBush<DirectedVertex,EdgeSegment>
-
- org.goplanit.assignment.ltm.sltm.RootedLabelledBush
-
- org.goplanit.assignment.ltm.sltm.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 Summary
Fields Modifier and Type Field Description protected CentroidVertex
destination
Destination of this bush-
Fields inherited from class org.goplanit.assignment.ltm.sltm.RootedLabelledBush
bushData
-
Fields inherited from class org.goplanit.assignment.ltm.sltm.RootedBush
bushGroupingToken, originDemandsPcuH, requireTopologicalSortUpdate
-
-
Constructor Summary
Constructors Constructor Description DestinationBush(DestinationBush bush, boolean deepCopy)
Copy constructorDestinationBush(IdGroupingToken idToken, CentroidVertex destination, long maxSubGraphEdgeSegments)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addOriginDemandPcuH(CentroidVertex originCentroidVertex, double demandPcuH)
add origin demand for this origin bushMinMaxPathResult
computeMinMaxShortestPaths(double[] linkSegmentCosts, int totalTransportNetworkVertices)
Compute the min-max path tree rooted at the destination towards all origins given the provided (network wide) costs.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.CentroidVertex
getDestination()
collect destination of this bushCentroidVertex
getRootZoneVertex()
Each rooted bush is expected to have a zone attached to its root vertex, which is to be returned hereShortestSearchType
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.Iterator<DirectedVertex>
getTopologicalIterator(boolean originDestinationDirection)
Collect an iterator over topologically sorted bush in origin-destination or destination-origin direction.DestinationBush
shallowClone()
Create a shallow copy of this entityString
toString()
-
Methods inherited from class org.goplanit.assignment.ltm.sltm.RootedLabelledBush
addTurnSendingFlow, addTurnSendingFlow, computeSubPathAcceptedFlow, computeSubPathSendingFlow, containsAnyEdgeSegmentOf, containsEdgeSegment, containsTurnSendingFlow, containsTurnSendingFlow, determineIntroduceCycle, determineProportionalFlowCompositionRates, determineSubPathSendingFlow, findBushAlternativeSubpath, getDag, getFirstFlowCompositionLabel, getFlowCompositionLabels, getSendingFlowPcuH, getSendingFlowPcuH, getSplittingRate, getSplittingRate, getSplittingRates, getSplittingRates, getTurnSendingFlow, getTurnSendingFlow, hasFlowCompositionLabel, hasFlowCompositionLabel, isEmpty, relabel, relabelFrom, relabelTo, removeEdgeSegment, removeTurn, syncToNetworkFlows
-
Methods inherited from class org.goplanit.assignment.ltm.sltm.RootedBush
getDirectedVertexIterator, getId, getOriginDemandPcuH, getOriginVertices, getRootVertex, isInverted
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.goplanit.utils.id.IdAble
compareTo, idEquals, idHashCode
-
-
-
-
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 ondestination
- destination of the bushmaxSubGraphEdgeSegments
- 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 copydeepCopy
- 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 classRootedLabelledBush
- Parameters:
linkSegmentCosts
- to usetotalTransportNetworkVertices
- 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
-
getRootZoneVertex
public CentroidVertex getRootZoneVertex()
Each rooted bush is expected to have a zone attached to its root vertex, which is to be returned here- Specified by:
getRootZoneVertex
in classRootedBush<DirectedVertex,EdgeSegment>
- Returns:
- root zone
-
shallowClone
public DestinationBush shallowClone()
Create a shallow copy of this entity- Specified by:
shallowClone
in interfaceBush
- Specified by:
shallowClone
in interfaceIdAble
- Specified by:
shallowClone
in classRootedLabelledBush
- Returns:
- shallow copy of entity
-
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
-
toString
public String toString()
- Overrides:
toString
in classRootedLabelledBush
-
getDestination
public CentroidVertex getDestination()
collect destination of this bush- Returns:
- destination zone
-
addOriginDemandPcuH
public void addOriginDemandPcuH(CentroidVertex originCentroidVertex, double demandPcuH)
add origin demand for this origin bush- Overrides:
addOriginDemandPcuH
in classRootedBush<DirectedVertex,EdgeSegment>
- Parameters:
originCentroidVertex
- to add fordemandPcuH
- demand to add
-
-