public class TspOp2 extends java.lang.Object implements TSP, XMLConfigurable
TSP.TourFlag
Constructor and Description |
---|
TspOp2()
Default constructor.
|
TspOp2(LinkCostCalculator[] lccs, NodeCostCalculator[] nccs, ShortestPath spAlgorithm, PairwiseCostCalculator pwcc)
Constructs an 2-opt tsp algorithm instance.
|
TspOp2(LinkCostCalculator[] lccs, NodeCostCalculator[] nccs, ShortestPath spAlgorithm, PairwiseCostCalculator pwcc, double tolerance)
Constructs an 2-opt tsp algorithm instance.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getXMLSchema()
Returns the XML schema for the input parameter.
|
void |
init(org.w3c.dom.Element parameter)
Initializes the XML configurable object with the input parameter.
|
void |
setNetworkAnalyst(NetworkAnalyst analyst)
This method allows caller to pass the network analyst object to this TSP algorithm implementation, so that the algorithm can call the analysis functions provided by the network analyst, or access the network explorer associated with the network analyst.
|
TspPath |
tspPath(PointOnNet[][] points, TSP.TourFlag tourFlag, LODNetworkConstraint constraint)
Returns the traveling salesman tour with the optimal or suboptimal cost.
|
public TspOp2()
public TspOp2(LinkCostCalculator[] lccs, NodeCostCalculator[] nccs, ShortestPath spAlgorithm, PairwiseCostCalculator pwcc)
lccs
- link cost calculatorsnccs
- node cost calculatorsspAlgorithm
- shortest path algorithm to compute the cost between two pointspwcc
- calculator to compute the cost between any two tsp pointspublic TspOp2(LinkCostCalculator[] lccs, NodeCostCalculator[] nccs, ShortestPath spAlgorithm, PairwiseCostCalculator pwcc, double tolerance)
lccs
- link cost calculatorsnccs
- node cost calculatorsspAlgorithm
- shortest path algorithm to compute the cost between two pointspwcc
- calculator to compute the cost between any two tsp pointstolerance
- tolerance for minimum cost improvementpublic TspPath tspPath(PointOnNet[][] points, TSP.TourFlag tourFlag, LODNetworkConstraint constraint) throws LODNetworkException
TSP
tspPath
in interface TSP
points
- points to visit on the TSP tour.tourFlag
- a flag indicating whether the tour should be open or closed, and if the tour is open, whether the tour should have fixed start or end point.constraint
- network constraintLODNetworkException
public void setNetworkAnalyst(NetworkAnalyst analyst)
TSP
setNetworkAnalyst
in interface TSP
public void init(org.w3c.dom.Element parameter)
XMLConfigurable
init
in interface XMLConfigurable
parameter
- an XML element containing the necessary information to initialize the object.public java.lang.String getXMLSchema()
XMLConfigurable
getXMLSchema
in interface XMLConfigurable