Class TspImpl

  • All Implemented Interfaces:
    TSP
    Direct Known Subclasses:
    TspOp2

    public class TspImpl
    extends java.lang.Object
    implements TSP
    The default two step TSP implementation, which first computes the pairwise costs between the TSP stops, and then optimizes the order the stops to be visited.
    Since:
    12.2
    • Method Detail

      • setDirection

        public void setDirection​(int direction)
      • getDirection

        public int getDirection()
      • setTspOptimizer

        public void setTspOptimizer​(TspOptimizer optimizer)
      • setShortestPathAlgorithm

        public void setShortestPathAlgorithm​(ShortestPath spAlgorithm)
      • getShortestPathAlgorithm

        public ShortestPath getShortestPathAlgorithm()
      • setNetworkAnalyst

        public void setNetworkAnalyst​(NetworkAnalyst analyst)
        Description copied from interface: TSP
        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. If network analyst is not needed by the shortest path algorithm, the algorithm can choose to do nothing with this method.
        Specified by:
        setNetworkAnalyst in interface TSP
      • tspPath

        public TspPath tspPath​(PointOnNet[][] points,
                               TSP.TourFlag tourFlag,
                               LODNetworkConstraint networkConstraint,
                               TspConstraint tspConstraint)
                        throws LODNetworkException
        Description copied from interface: TSP
        Returns the traveling salesman tour with the optimal or suboptimal cost.
        Specified by:
        tspPath in interface TSP
        Parameters:
        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.
        networkConstraint - network constraint
        tspConstraint - tsp constraint
        Throws:
        LODNetworkException