public class AlternativeRoute extends Object implements RoutingAlgorithm
Modifier and Type | Class and Description |
---|---|
static class |
AlternativeRoute.AlternativeBidirSearch
Helper class to find alternatives and alternatives for round trip.
|
static class |
AlternativeRoute.AlternativeInfo |
static class |
AlternativeRoute.PlateauInfo |
Constructor and Description |
---|
AlternativeRoute(Graph graph,
Weighting weighting,
TraversalMode traversalMode) |
Modifier and Type | Method and Description |
---|---|
List<AlternativeRoute.AlternativeInfo> |
calcAlternatives(int from,
int to)
This method calculates best paths (alternatives) between 'from' and 'to', where maxPaths-1
alternatives are searched and they are only accepted if they are not too similar but close to
the best path.
|
Path |
calcPath(int from,
int to)
Calculates the best path between the specified nodes.
|
List<Path> |
calcPaths(int from,
int to)
Calculates multiple possibilities for a path.
|
String |
getName() |
int |
getVisitedNodes()
Returns the visited nodes after searching.
|
void |
setApproximation(WeightApproximator weightApproximator)
This method sets the approximation used for the internal bidirectional A*.
|
void |
setMaxExplorationFactor(double explorationFactor)
This method sets the graph exploration percentage for alternative paths.
|
void |
setMaxPaths(int maxPaths)
Specifies how many paths (including the optimal) are returned.
|
void |
setMaxShareFactor(double maxShareFactor)
This parameter is used to avoid alternatives too similar to the best path.
|
void |
setMaxVisitedNodes(int numberOfNodes)
Limit the search to numberOfNodes.
|
void |
setMaxWeightFactor(double maxWeightFactor)
Increasing this factor results in returning more alternatives.
|
void |
setMinPlateauFactor(double minPlateauFactor)
This method sets the minimum plateau portion of every alternative path that is required.
|
public AlternativeRoute(Graph graph, Weighting weighting, TraversalMode traversalMode)
public void setApproximation(WeightApproximator weightApproximator)
public void setMaxVisitedNodes(int numberOfNodes)
RoutingAlgorithm
setMaxVisitedNodes
in interface RoutingAlgorithm
public void setMaxWeightFactor(double maxWeightFactor)
public void setMaxShareFactor(double maxShareFactor)
public void setMinPlateauFactor(double minPlateauFactor)
public void setMaxExplorationFactor(double explorationFactor)
public void setMaxPaths(int maxPaths)
public List<AlternativeRoute.AlternativeInfo> calcAlternatives(int from, int to)
public Path calcPath(int from, int to)
RoutingAlgorithm
calcPath
in interface RoutingAlgorithm
public List<Path> calcPaths(int from, int to)
RoutingAlgorithm
calcPaths
in interface RoutingAlgorithm
RoutingAlgorithm.calcPath(int, int)
public String getName()
getName
in interface RoutingAlgorithm
public int getVisitedNodes()
RoutingAlgorithm
getVisitedNodes
in interface RoutingAlgorithm
Copyright © 2012–2020. All rights reserved.