public abstract class AbstractBidirAlgo extends Object implements BidirRoutingAlgorithm
| Modifier and Type | Field and Description |
|---|---|
protected SPTEntry |
bestBwdEntry |
protected SPTEntry |
bestFwdEntry |
protected double |
bestWeight |
protected com.carrotsearch.hppc.IntObjectMap<SPTEntry> |
bestWeightMapFrom |
protected com.carrotsearch.hppc.IntObjectMap<SPTEntry> |
bestWeightMapOther |
protected com.carrotsearch.hppc.IntObjectMap<SPTEntry> |
bestWeightMapTo |
protected SPTEntry |
currFrom |
protected SPTEntry |
currTo |
protected boolean |
finishedFrom |
protected boolean |
finishedTo |
protected int |
from |
protected int |
fromOutEdge |
protected int |
maxVisitedNodes |
protected int |
to |
protected int |
toInEdge |
protected TraversalMode |
traversalMode |
protected boolean |
updateBestPath |
| Constructor and Description |
|---|
AbstractBidirAlgo(TraversalMode traversalMode) |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
bwdSearchCanBeStopped() |
Path |
calcPath(int from,
int to)
Calculates the best path between the specified nodes.
|
Path |
calcPath(int from,
int to,
int fromOutEdge,
int toInEdge)
like
RoutingAlgorithm.calcPath(int, int), but this method also allows to strictly restrict the edge the
path will begin with and the edge it will end with. |
List<Path> |
calcPaths(int from,
int to)
Calculates multiple possibilities for a path.
|
protected void |
checkAlreadyRun() |
protected abstract SPTEntry |
createStartEntry(int node,
double weight,
boolean reverse)
Creates the root shortest path tree entry for the forward or backward search.
|
protected abstract Path |
extractPath() |
protected boolean |
finished() |
protected boolean |
fromEntryCanBeSkipped() |
protected boolean |
fwdSearchCanBeStopped() |
protected double |
getCurrentFromWeight() |
protected double |
getCurrentToWeight() |
protected int |
getIncomingEdge(SPTEntry entry) |
protected abstract double |
getInEdgeWeight(SPTEntry entry) |
String |
getName() |
int |
getVisitedNodes()
Returns the visited nodes after searching.
|
protected void |
initCollections(int size) |
protected void |
initFrom(int from,
double weight) |
protected void |
initTo(int to,
double weight) |
protected boolean |
isMaxVisitedNodesExceeded() |
protected void |
postInit(int from,
int to) |
protected abstract void |
postInitFrom() |
protected abstract void |
postInitTo() |
protected void |
runAlgo() |
void |
setMaxVisitedNodes(int numberOfNodes)
Limit the search to numberOfNodes.
|
protected void |
setUpdateBestPath(boolean b) |
protected boolean |
toEntryCanBeSkipped() |
protected void |
updateBestPath(double edgeWeight,
SPTEntry entry,
int origEdgeIdForCH,
int traversalId,
boolean reverse) |
protected final TraversalMode traversalMode
protected int from
protected int to
protected int fromOutEdge
protected int toInEdge
protected com.carrotsearch.hppc.IntObjectMap<SPTEntry> bestWeightMapFrom
protected com.carrotsearch.hppc.IntObjectMap<SPTEntry> bestWeightMapTo
protected com.carrotsearch.hppc.IntObjectMap<SPTEntry> bestWeightMapOther
protected SPTEntry currFrom
protected SPTEntry currTo
protected SPTEntry bestFwdEntry
protected SPTEntry bestBwdEntry
protected double bestWeight
protected int maxVisitedNodes
protected boolean updateBestPath
protected boolean finishedFrom
protected boolean finishedTo
public AbstractBidirAlgo(TraversalMode traversalMode)
protected void initCollections(int size)
protected abstract SPTEntry createStartEntry(int node, double weight, boolean reverse)
public List<Path> calcPaths(int from, int to)
RoutingAlgorithmcalcPaths in interface RoutingAlgorithmRoutingAlgorithm.calcPath(int, int)public Path calcPath(int from, int to)
RoutingAlgorithmcalcPath in interface RoutingAlgorithmpublic Path calcPath(int from, int to, int fromOutEdge, int toInEdge)
BidirRoutingAlgorithmRoutingAlgorithm.calcPath(int, int), but this method also allows to strictly restrict the edge the
path will begin with and the edge it will end with.calcPath in interface BidirRoutingAlgorithmfromOutEdge - the edge id of the first edge of the path. using EdgeIterator.ANY_EDGE means
not enforcing the first edge of the pathtoInEdge - the edge id of the last edge of the path. using EdgeIterator.ANY_EDGE means
not enforcing the last edge of the pathprotected void initFrom(int from,
double weight)
protected void initTo(int to,
double weight)
protected void postInit(int from,
int to)
protected abstract void postInitFrom()
protected abstract void postInitTo()
protected void runAlgo()
protected boolean finished()
protected void updateBestPath(double edgeWeight,
SPTEntry entry,
int origEdgeIdForCH,
int traversalId,
boolean reverse)
protected abstract double getInEdgeWeight(SPTEntry entry)
protected int getIncomingEdge(SPTEntry entry)
protected abstract Path extractPath()
protected boolean fromEntryCanBeSkipped()
protected boolean fwdSearchCanBeStopped()
protected boolean toEntryCanBeSkipped()
protected boolean bwdSearchCanBeStopped()
protected double getCurrentFromWeight()
protected double getCurrentToWeight()
protected void setUpdateBestPath(boolean b)
public int getVisitedNodes()
RoutingAlgorithmgetVisitedNodes in interface RoutingAlgorithmpublic void setMaxVisitedNodes(int numberOfNodes)
RoutingAlgorithmsetMaxVisitedNodes in interface RoutingAlgorithmprotected void checkAlreadyRun()
public String getName()
getName in interface RoutingAlgorithmprotected boolean isMaxVisitedNodesExceeded()
Copyright © 2012–2022. All rights reserved.