com.supermap.services.components.impl

Class TransportationAnalystImpl

  • java.lang.Object
    • com.supermap.services.components.impl.TransportationAnalystImpl
  • All Implemented Interfaces:
    ComponentContextAware, Disposable, TransportationAnalyst


    public class TransportationAnalystImpl
    extends java.lang.Object
    implements TransportationAnalyst, ComponentContextAware, Disposable
    

    The implementation class of the transportation network analysis service component interface.

    Transportation network analysis service components are a set of GIS service components encapsulating all the GIS functions related to transportation network analysis. Network models can be divided into transportation network and facility network (directed). It includes closest facility finding, location-allocation, TSP analysis, MTSP analysis, optimal path analysis, and service area analysis.

    The service providers in a transportation network analysis service component must be transportation network analysis service providers (TransportationAnalystProvider).

    • Constructor Detail

      • TransportationAnalystImpl

        public TransportationAnalystImpl()
        
    • Method Detail

      • setComponentContext

        public void setComponentContext(ComponentContext context)
        

        Sets the context of transportation network analysis service component.

        A transportation network analysis service component can be directly initialized through setting its context.

        Specified by:
        setComponentContext in interface ComponentContextAware
        Parameters:
        context - The context of transportation network analysis service component.
      • dispose

        public void dispose()
        

        Releases the resources used by a transportation network analysis service component.

        Specified by:
        dispose in interface Disposable
      • computeWeightMatrix

        public double[][] computeWeightMatrix(int[] nodeIDs,
                                     java.lang.String networkDataName,
                                     TransportationAnalystParameter parameter)
        

        Gets a cost matrix according to the network analysis parameter.The matrix is a 2D double array used to store the resource cost between any two points.

        Specified by:
        computeWeightMatrix in interface TransportationAnalyst
        Parameters:
        nodeIDs - The set of IDs of the nodes used to compute the cost matrix.
        networkDataName - Required, used to uniquely identify the network dataset. It is one of elements of the array returned by getNetworkDataNames().
        parameter - The common parameter for setting transportation network analysis. It's optional, and uses the settings of TransportationAnalystSetting by default.
        Returns:
        The 2D double array used to store the resource cost between any two points.
      • computeWeightMatrix

        public double[][] computeWeightMatrix(Point2D[] points,
                                     java.lang.String networkDataName,
                                     TransportationAnalystParameter parameter)
        

        Gets a cost matrix according to the network analysis parameter.The matrix is a 2D double array used to store the resource cost between any two points.

        Specified by:
        computeWeightMatrix in interface TransportationAnalyst
        Parameters:
        points - The points to calculate the cost matrix.
        networkDataName - Required, used to uniquely identify the network dataset. It is one of elements of the array returned by getNetworkDataNames().
        parameter - The common parameter for setting transportation network analysis. It's optional, and uses the settings of TransportationAnalystSetting by default.
        Returns:
        The 2D double array used to store the resource cost between any two points.
      • findClosestFacility

        public ClosestFacilityPaths<java.lang.Integer> findClosestFacility(int[] facilityIDs,
                                                                  int event,
                                                                  int expectFacilityCount,
                                                                  boolean fromEvent,
                                                                  double maxWeight,
                                                                  java.lang.String networkDataName,
                                                                  TransportationAnalystParameter parameter)
        

        Closest facility analysis, in which events are represented by network node IDs.

        The closest facility analysis is to find one or more facilities to which the cost from the event point is the least among the given event point and a set of facilities. The result is the optimal path from the event point to the facility (or from the facility to the event point).

        • The facility: the basic element of the closest facility analysis, such as the school, supermarket, gas station, etc.
        • The event: the basic element of the closest facility analysis--the location that needs service facilities.

        For example: A traffic accident happens in the street, and we need to find out hospitals that are able to be reached within 10 minutes, with hospitals out of 10 minutes' ride out of consideration.In this instance, the accident location is an event, the hospitals around are the facilities.

        In the closest facility analysis, there are two methods to specify the event.One is to specify according to the coordinates, and the other one is to specify according to network node ID, ie., specify the network node as the event. This method specifies the event by using node ID.

        Specified by:
        findClosestFacility in interface TransportationAnalyst
        Parameters:
        facilityIDs - The facility node ID array. Required.
        event - The event node ID. Required.
        expectFacilityCount - The amount of the expected facilities to search. Optional. The default value is 1.
        fromEvent - Whether to start the search from the event. Optional. The default value is false.
        maxWeight - The searching radius. Required. It has the same unit as the weight field in parameter (the general parameter for transportation network analysis). If the search is based on the entire network, set this parameter to 0.
        networkDataName - Required, used to uniquely identify the network dataset. It is one of elements of the array returned by getNetworkDataNames().
        parameter - The common parameter for setting transportation network analysis. It's optional, and uses the settings of TransportationAnalystSetting by default.
        Returns:
        The result path set of closest facility analysis.
      • findClosestFacility

        public ClosestFacilityPaths<Point2D> findClosestFacility(Point2D[] facilityPoints,
                                                        Point2D event,
                                                        int expectFacilityCount,
                                                        boolean fromEvent,
                                                        double maxWeight,
                                                        java.lang.String networkDataName,
                                                        TransportationAnalystParameter parameter)
        

        Closest facility analysis, in which events are represented by point coordinates.

        The closest facility analysis is to find one or more facilities to which the cost from the event point is the least among the given event point and a set of facilities. The result is the optimal path from the event point to the facility (or from the facility to the event point).

        • The facility: the basic element of the closest facility analysis, such as the school, supermarket, gas station, etc.
        • The event: the basic element of the closest facility analysis--the location that needs service facilities.

        For example: A traffic accident happens in the street, and we need to find out hospitals that are able to be reached within 10 minutes, with hospitals out of 10 minutes' ride out of consideration.In this instance, the accident location is an event, the hospitals around are the facilities.

        In the closest facility analysis, there are two methods to specify the event.One is to specify according to the coordinates, and the other one is to specify according to network node ID, ie., specify the network node as the event. This method specifies the event by using coordinate of point.

        Specified by:
        findClosestFacility in interface TransportationAnalyst
        Parameters:
        facilityPoints - The coordinate points array representing facilities. Required.
        event - The coordinate point representing event. Required.
        expectFacilityCount - The amount of the expected facilities to search. Optional. The default value is 1.
        fromEvent - Whether to start the search from the event. Optional. The default value is false.
        maxWeight - The searching radius. Required. It has the same unit as the weight field in parameter (the general parameter for transportation network analysis). If the search is based on the entire network, set this parameter to 0.
        networkDataName - Required, used to uniquely identify the network dataset. It is one of elements of the array returned by getNetworkDataNames().
        parameter - The common parameter for setting transportation network analysis. It's optional, and uses the settings of TransportationAnalystSetting by default.
        Returns:
        The result path set of closest facility analysis.
      • findLocation

        public LocationAnalystResult findLocation(LocationAnalystParameter parameter,
                                         java.lang.String networkDataName)
        

        The location-allocation analysis.

        The location-allocation analysis is to determine one or more best or optimal positions to build facilities, which makes facilities use one of the most economic and efficient way to provide service or commodity. Location-Allocation is not only o find the best locations, it also needs to consider how many resource each location should provide based on the demands. So it's called Location-Allocation.

        In location-allocation analysis, the SupplyCenter and analysis model are set with LocationAnalystParameter. Please see LocationAnalystParameter class for more detailes.

        In location-allocation analysis, all demand points are network nodes. Except for the network nodes corresponding to the supply center points, all network nodes demand points. To exclude certain network nodes, you can set the nodes as barriers.

        Example: 7 post offices will be built in an area with 15 candidate locations, represented by blue rectangles in the figure 1 below, that has no post offices. Which locations will be selected to build post offices depending on the following two conditions: no more than 30 minutes by walk for residents and the amount of residents a post office can serve is limited. Based on the two conditions, location-allocation analysis will give optimal locations and points out the service area of each post office. As shown is the figure 2 below, the red points represent the 7 selected locations for setting up post offices.

        Note: All network nodes of the following two network datasets are regarded as the residential areas and will participate in the location-allocation analysis. The resident number in the residential area is the amount of services the residential area needs.


        Figure 1. A diagram of network dataset to analyze and 15 candidate center points


        Figure 2. A diagram of the location-allocation analysis result

        Specified by:
        findLocation in interface TransportationAnalyst
        Parameters:
        parameter - The common parameter for setting transportation network analysis. It's optional, and uses the settings of TransportationAnalystSetting by default.
        networkDataName - Required, used to uniquely identify the network dataset. It is one of elements of the array returned by getNetworkDataNames().
        Returns:
        The location-allocation analysis result.
      • findMTSPPath

        public MTSPPaths<java.lang.Integer> findMTSPPath(int[] nodeIDs,
                                                int[] centerIDs,
                                                boolean hasLeastTotalCost,
                                                java.lang.String networkDataName,
                                                TransportationAnalystParameter parameter)
        

        The multiple traveling salesmen analysis (logistics). The logistics center is represented by the ID array of network nodes.

        The multiple traveling salesmen analysis is also called logistics. It means with the M centers and N destinations (M, N are both greater than 0) in network dataset, to find the economic and effective delivering path from the supply center to destination, and show the corresponding walk path.

        Logistics refers to the problem that how to determine the order of the destinations to be delivered and the best route so as to minimize the total cost of the route.

        The MTSP result will list each distribution center and its delivery destinations, the order of the delivery for the destinations and the delivery routes. So as to make the delivery cost for each center at a average level, or minimize the total cost of all the centers.

        Example: There are 50 newspaper retailers (destinations), and 4 newspaper supply locations (supply centers). Now we need to find out the optimal path to deliver the newspaper to the retailers, which is a logistics problem. The following figure demonstrates this example.

        Figure 1 shows the analysis result, where the big circles represent the 4 newspaper supply locations (supply centers) and the small circles represent the newspaper retailers (destinations). Each color represents a solution for one supply center, including its destinations, the visited order and the delivery route. Figure 2 shows the delivery solution of Supply Center 2. Blue circles with numbers are destinations (18 in total) of the Supply Center 2. Newspaper will be delivered in the order indicated by the numbers on the blue circles, with the delivery man starting at the supply center, passing through 1, 2, etc., and then go back to the supply center.

        Figure 1. The result of multiple traveling salesmen analysis

        Figure 2. The delivery solution for Supply Center 2

        Specified by:
        findMTSPPath in interface TransportationAnalyst
        Parameters:
        nodeIDs - The destination node ID array. Required.
        centerIDs - The ID array of the supply centers. Required.
        hasLeastTotalCost - Whether the delivery solution has the least total cost. Optional. The default is false, indicating to adopt the locally optimal solution. If set to true, the solution with the least total cost will be adopted.

        In the solution with the least total cost, the cost of certain supply centers may be far more than some other supply centers. The locally optimal cost solution balances the cost of all supply centers to make them have similar cost, but the total cost may not be the least.

        networkDataName - Required, used to uniquely identify the network dataset. It is one of elements of the array returned by getNetworkDataNames().
        parameter - The common parameter for setting transportation network analysis. It's optional, and uses the settings of TransportationAnalystSetting by default.
        Returns:
        The result set of multiple traveling salesmen analysis.
      • findMTSPPath

        public MTSPPaths<Point2D> findMTSPPath(Point2D[] points,
                                      Point2D[] centers,
                                      boolean hasLeastTotalCost,
                                      java.lang.String networkDataName,
                                      TransportationAnalystParameter parameter)
        

        The multiple traveling salesmen analysis (logistics). The logistics center is represented by the coordinates of network nodes.

        The multiple traveling salesmen analysis is also called logistics. It means with the M centers and N destinations (M, N are both greater than 0) in network dataset, to find the economic and effective delivering path from the supply center to destination, and show the corresponding walk path.

        Logistics refers to the problem that how to determine the order of the destinations to be delivered and the best route so as to minimize the total cost of the route.

        The MTSP result will list each distribution center and its delivery destinations, the order of the delivery for the destinations and the delivery routes. So as to make the delivery cost for each center at a average level, or minimize the total cost of all the centers.

        Example: There are 50 newspaper retailers (destinations), and 4 newspaper supply locations (supply centers). Now we need to find out the optimal path to deliver the newspaper to the retailers, which is a logistics problem. The following figure demonstrates this example.

        Figure 1 shows the analysis result, where the big circles represent the 4 newspaper supply locations (supply centers) and the small circles represent the newspaper retailers (destinations). Each color represents a solution for one supply center, including its destinations, the visited order and the delivery route. Figure 2 shows the delivery solution of Supply Center 2. Blue circles with numbers are destinations (18 in total) of the Supply Center 2. Newspaper will be delivered in the order indicated by the numbers on the blue circles, with the delivery man starting at the supply center, passing through 1, 2, etc., and then go back to the supply center.

        Figure 1. The result of multiple traveling salesmen analysis

        Figure 2. The delivery solution for Supply Center 2

        Specified by:
        findMTSPPath in interface TransportationAnalyst
        Parameters:
        points - The points array of the destinations represented by coordinates. Required.
        centers - The points array of the supply centers represented by coordinates. Required.
        hasLeastTotalCost - Whether the delivery solution has the least total cost. The default is false, indicating to adopt the locally optimal solution. If set to true, the solution with the least total cost will be adopted.

        In the solution with the least total cost, the cost of certain supply centers may be far more than some other supply centers. The locally optimal cost solution balances the cost of all supply centers to make them have similar cost, but the total cost may not be the least.

        networkDataName - Required, used to uniquely identify the network dataset. It is one of elements of the array returned by getNetworkDataNames().
        parameter - The common parameter for setting transportation network analysis. It's optional, and uses the settings of TransportationAnalystSetting by default.
        Returns:
        The result set of multiple traveling salesmen analysis.
      • findPath

        public Paths findPath(int[] nodeIDs,
                     boolean hasLeastEdgeCount,
                     java.lang.String networkDataName,
                     TransportationAnalystParameter parameter)
        

        Optimal path analysis.

        The optimal path analysis aims at finding out the path with the minimum impedance in the network dataset with the given N points (N is greater than 2). The "minimum impedance" can refer to the shortest time, the minimum cost, the best scenery, the best road condition, passing the least bridges, passing the least toll-stations, passing the most countries, etc.

        This method returns a path with the minimum impedance passing all the N points in a certain order.

        Example: Suppose there are four nodes, 1, 2, 3, and 4, to be accessed in order. To find the optimal path needs to first find the optimal paths between node 1 and 2, node 2 and 3, as well as node 3 and 4, represented with R1_2, R2_3, R3_4, respectively. Then the optimal path passing nodes 1, 2, 3, and 4 in order is R which equals to R1_2 + R2_3 + R3_4.

        Similarities and differences between optimal path analysis and traveling salesmen analysis:

        • Similarities: Both of them aim at finding out the least cost path by traversing network nodes.
        • The difference: They handle the order in which the points are visited differently. In an optimal path analysis, the points have to be visited in a specified order. Whereas in a traveling salesmen analysis, the best order for visiting the points is to be determined and is not necessarily the same with any specified order. For detailed information on traveling salesmen analysis, please see the findTSPPath(int[],boolean,java.lang.String,com.supermap.services.components.commontypes.TransportationAnalystParameter).

        }
        Specified by:
        findPath in interface TransportationAnalyst
        Parameters:
        nodeIDs - The node ID array to pass through. This parameter is required.
        hasLeastEdgeCount - Whether the path has the least edges. This parameter is optional. The default is false.

        The path with the least number of edges may not be the shortest path. As shown in the figure below, the green path is the path with the least edges, with this parameter set to true, and the yellow path is the result path, with this parameter set to false.

        networkDataName - Required, used to uniquely identify the network dataset. It is one of elements of the array returned by getNetworkDataNames().
        parameter - The common parameter for setting transportation network analysis. It's optional, and uses the settings of TransportationAnalystSetting by default.
        Returns:
        The optimal path analysis result set, which includes only one element now.
      • findPath

        public Paths findPath(Point2D[] points,
                     boolean hasLeastEdgeCount,
                     java.lang.String networkDataName,
                     TransportationAnalystParameter parameter)
        

        Optimal path analysis.

        The optimal path analysis aims at finding out the path with the minimum impedance in the network dataset with the given N points (N is greater than 2). The "minimum impedance" can refer to the shortest time, the minimum cost, the best scenery, the best road condition, passing the least bridges, passing the least toll-stations, passing the most countries, etc.

        This method returns a path with the minimum impedance passing all the N points in a certain order.

        Example: Suppose there are four nodes, 1, 2, 3, and 4, to be accessed in order. To find the optimal path needs to first find the optimal paths between node 1 and 2, node 2 and 3, as well as node 3 and 4, represented with R1_2, R2_3, R3_4, respectively. Then the optimal path passing nodes 1, 2, 3, and 4 in order is R which equals to R1_2 + R2_3 + R3_4.

        Similarities and differences between optimal path analysis and traveling salesmen analysis:

        • Similarities: Both of them aim at finding out the least cost path by traversing network nodes.
        • The difference: They handle the order in which the points are visited differently. In an optimal path analysis, the points have to be visited in a specified order. Whereas in a traveling salesmen analysis, the best order for visiting the points is to be determined and is not necessarily the same with any specified order. For detailed information on traveling salesmen analysis, please see the findTSPPath(int[],boolean,String,TransportationAnalystParameter) method.

        }
        Specified by:
        findPath in interface TransportationAnalyst
        Parameters:
        points - The point array to pass through. This parameter is required.
        hasLeastEdgeCount - Whether the path has the least edges. This parameter is optional. The default is false.

        The path with the least number of edges may not be the shortest path. As shown in the figure below, the green path is the path with the least edges, with this parameter set to true, and the yellow path is the result path, with this parameter set to false.

        networkDataName - Required, used to uniquely identify the network dataset. It is one of elements of the array returned by getNetworkDataNames().
        parameter - The common parameter for setting transportation network analysis. It's optional, and uses the settings of TransportationAnalystSetting by default.
        Returns:
        The optimal path analysis result set, which includes only one element now.
      • findServiceArea

        public ServiceAreaResults<java.lang.Integer> findServiceArea(int[] centerIDs,
                                                            double[] weights,
                                                            boolean isFromCenter,
                                                            boolean isCenterMutuallyExclusive,
                                                            java.lang.String networkDataName,
                                                            TransportationAnalystParameter parameter)
        

        The service area analysis.

        The service area analysis is to find the area the supply center serves in the network.

        Service area: The area contains all the accessible edges and nodes, with the specified point as the center. In short, it is the area that a supply location of a specific service serves.

        Service area analysis: Calculates the service area for a specified point in the network. For instance, we can calculate the 30-minute service area for a point in the network. In this result service area, the time cost from the point to any point in the service area will be less than 30 minutes.

        The following image shows what is the service area analysis result like and what problems the service area analysis solves. The blue circles in the figure below represent the supply center that supplies services. Areas in different colors are service areas of the supply center with different impedances.

        Specified by:
        findServiceArea in interface TransportationAnalyst
        Parameters:
        centerIDs - The center ID array. This parameter is required.
        weights - The service radius collection. This parameter is required. The collection size is the same as the center count. This parameter identifies the value range that used in the service area analysis. If we set weights[0] to 30.0, it indicates that it shouldn't take more than 30 minutes to get to the 1st supply center from any points of the service area of the 1st point.
        isFromCenter - whether to analyze from the supply center point. The parameter is optional. The default is false, which means the analysis doesn't start from the center point.

        Whether to analyze from the center point shows the relation mode between the supply center and the demand points. If the analysis starts from the supply center, it means the supply center actively delivers services to demand points. If the analysis doesn't start from the supply center, the demand point actively gets the services from the supply center and the supply center passively provides the services

        For instance, when analyzing the service area of a milk station, isFromCenter needs to be set to true because the milk station actively sends milk to residents. However, when analyzing the service area of a school, isFromCetner needs to be set to false because students actively come to the school to have classes every day.

        isCenterMutuallyExclusive - Whether the service areas are mutually exclusive. This parameter is optional. The default is false, which means service areas are not mutually exclusive. If set to true, overlapping service areas will be handled.

        Below shows the effects before and after exclusion handling.

        A result without no-overlay processing A result after overlay processing

        networkDataName - Required, used to uniquely identify the network dataset. It is one of elements of the array returned by getNetworkDataNames().
        parameter - The common parameter for setting transportation network analysis. It's optional, and uses the settings of TransportationAnalystSetting by default.
        Returns:
        The service area analysis result. It is an array whose size is the same with the number of the supply center. Every element in the array corresponds to the description of a service area of a supply center.
      • findServiceArea

        public ServiceAreaResults<Point2D> findServiceArea(Point2D[] centerPoints,
                                                  double[] weights,
                                                  boolean isFromCenter,
                                                  boolean isCenterMutuallyExclusive,
                                                  java.lang.String networkDataName,
                                                  TransportationAnalystParameter parameter)
        

        The service area analysis.

        The service area analysis is to find the area the supply center serves in the network.

        Service area: The area contains all the accessible edges and nodes, with the specified point as the center. In short, it is the area that a supply location of a specific service serves.

        Service area analysis: Calculates the service area for a specified point in the network. For instance, we can calculate the 30-minute service area for a point in the network. In this result service area, the time cost from the point to any point in the service area will be less than 30 minutes.

        The following image shows what is the service area analysis result like and what problems the service area analysis solves. The blue circles in the figure below represent the supply center that supplies services. Areas in different colors are service areas of the supply center with different impedances.

        Specified by:
        findServiceArea in interface TransportationAnalyst
        Parameters:
        centerPoints - The points array of the service centers represented by coordinates. Required.
        weights - The service radius collection. This parameter is required. The collection size is the same as the center count. This parameter identifies the value range that used in the service area analysis. If we set weights[0] to 30.0, it indicates that it shouldn't take more than 30 minutes to get to the 1st supply center from any points of the service area of the 1st point.
        isFromCenter - whether to analyze from the supply center point. The parameter is optional. The default is false, which means the analysis doesn't start from the center point.

        Whether to analyze from the center point shows the relation mode between the supply center and the demand points. If the analysis starts from the supply center, it means the supply center actively delivers services to demand points. If the analysis doesn't start from the supply center, the demand point actively gets the services from the supply center and the supply center passively provides the services

        For instance, when analyzing the service area of a milk station, isFromCenter needs to be set to true because the milk station actively sends milk to residents. However, when analyzing the service area of a school, isFromCetner needs to be set to false because students actively come to the school to have classes every day.

        isCenterMutuallyExclusive - Whether the service areas are mutually exclusive. This parameter is optional. The default is false, which means service areas are not mutually exclusive. If set to true, overlapping service areas will be handled.

        Below shows the effects before and after exclusion handling.

        A result without no-overlay processing A result after overlay processing

        networkDataName - Required, used to uniquely identify the network dataset. It is one of elements of the array returned by getNetworkDataNames().
        parameter - The common parameter for setting transportation network analysis. It's optional, and uses the settings of TransportationAnalystSetting by default.
        Returns:
        The service area analysis result. It is an array whose size is the same with the number of the supply center. Every element in the array corresponds to the description of a service area of a supply center.
      • findTSPPath

        public TSPPaths findTSPPath(int[] nodeIDsToVisit,
                           boolean endNodeAssigned,
                           java.lang.String networkDataName,
                           TransportationAnalystParameter parameter)
        

        The traveling salesmen analysis.

        The traveling salesmen analysis is to find out the path that passes a specified set of points, with the least (or almost least) impedance. The order of passing those points are not fixed and is decided through the analysis.

        In traveling salesmen analysis, if the end node is specified, the traveling salesmen must access the end node last. The access order of other nodes is determined by the traveling salesmen.

        The passing points needed to be visited are specified by using nodeI|DsToVisit parameter, of which the first node is the starting point for the traveling salesman.

        Similarities and differences between optimal path analysis and traveling salesmen analysis:

        • Similarities: Both of them aim at finding out the least cost path by traversing network nodes.
        • The difference: They handle the order in which the points are visited differently. In an optimal path analysis, the points have to be visited in a specified order. Whereas in a traveling salesmen analysis, the best order for visiting the points is to be determined and is not necessarily the same with any specified order. For detailed information on optimal path analysis, please see the findPath(Point2D[],boolean,String,TransportationAnalystParameter).

        Specified by:
        findTSPPath in interface TransportationAnalyst
        Parameters:
        nodeIDsToVisit - The node ID array to pass through. This parameter is required.
        endNodeAssigned - Whether to assign the end node, which is an optional parameter. The default is false. If it is true, it represents assigning the end node. The traveling salesmen must access the end node, i.e., the last passing point.
        networkDataName - Required, used to uniquely identify the network dataset. It is one of elements of the array returned by getNetworkDataNames().
        parameter - The common parameter for setting transportation network analysis. It's optional, and uses the settings of TransportationAnalystSetting by default.
        Returns:
        The traveling salesmen analysis result collection, which only includes one element now.
      • findTSPPath

        public TSPPaths findTSPPath(Point2D[] pointsToVisit,
                           boolean endNodeAssigned,
                           java.lang.String networkDataName,
                           TransportationAnalystParameter parameter)
        

        The traveling salesmen analysis.

        The traveling salesmen analysis is to find out the path that passes a specified set of points, with the least (or almost least) impedance. The order of passing those points are not fixed and is decided through the analysis.

        In traveling salesmen analysis, if the end node is specified, the traveling salesmen must access the end node last. The access order of other nodes is determined by the traveling salesmen.

        The passing points needed to be visited are specified by using nodeI|DsToVisit parameter, of which the first node is the starting point for the traveling salesman.

        Similarities and differences between optimal path analysis and traveling salesmen analysis:

        • Similarities: Both of them aim at finding out the least cost path by traversing network nodes.
        • The difference: They handle the order in which the points are visited differently. In an optimal path analysis, the points have to be visited in a specified order. Whereas in a traveling salesmen analysis, the best order for visiting the points is to be determined and is not necessarily the same with any specified order. For detailed information on optimal path analysis, please see the findPath(Point2D[],boolean,String,TransportationAnalystParameter).

        Specified by:
        findTSPPath in interface TransportationAnalyst
        Parameters:
        pointsToVisit - The coordinate point array to pass through. This parameter is required.
        endNodeAssigned - Whether to assign the end node, which is an optional parameter. The default is false. If it is true, it represents assigning the end node. The traveling salesmen must access the end node, i.e., the last passing point.
        networkDataName - Required, used to uniquely identify the network dataset. It is one of elements of the array returned by getNetworkDataNames().
        parameter - The common parameter for setting transportation network analysis. It's optional, and uses the settings of TransportationAnalystSetting by default.
        Returns:
        The traveling salesmen analysis result collection, which only includes one element now.
      • getNetworkDataPrj

        public PrjCoordSys getNetworkDataPrj(java.lang.String networkDataName)
        

        Gets the projection information of specified network data.

        Specified by:
        getNetworkDataPrj in interface TransportationAnalyst
        Parameters:
        networkDataName - Used to uniquely identify the network dataset. It is one of elements of the array returned by getNetworkDataNames().
        Returns:
        The projection information of specified network data.
      • getNetworkDataNames

        public java.lang.String[] getNetworkDataNames()
        

        Gets the names of all the network datasets used in a transportation network analysis service component.

        Specified by:
        getNetworkDataNames in interface TransportationAnalyst
        Returns:
        The array of network dataset names.
      • updateEdgeWeight

        public double updateEdgeWeight(java.lang.String networkDataName,
                              int edgeID,
                              int fromNodeID,
                              int toNodeID,
                              java.lang.String weightField,
                              double weight)
        

        Updates the edge weight.

        Specified by:
        updateEdgeWeight in interface TransportationAnalyst
        Parameters:
        networkDataName - Used to uniquely identify the network dataset. It is one of elements of the array returned by getNetworkDataNames().
        edgeID - The target edge ID.
        fromNodeID - The start node ID of the target edge.
        toNodeID - The end node ID of the target edge.
        weightField - The name of the weight information (WeightFieldInfo corresponding to the target edge. Parameters fromNodeID and toNodeID determine which field to update, the from-to or the to-from field.
        weight - The new weight.
        Returns:
        The original weight if the update is successful, or the minimum value of the double data type otherwise.
      • updateTurnNodeWeight

        public double updateTurnNodeWeight(java.lang.String networkDataName,
                                  int nodeID,
                                  int fromEdgeID,
                                  int toEdgeID,
                                  java.lang.String turnWeightField,
                                  double weight)
        

        Updates the weight of turn node.

        Specified by:
        updateTurnNodeWeight in interface TransportationAnalyst
        Parameters:
        networkDataName - Used to uniquely identify the network dataset. It is one of elements of the array returned by getNetworkDataNames().
        nodeID - The target turn node ID.
        fromEdgeID - The start edge ID of the target turn node.
        toEdgeID - The end edge ID of the target turn node.
        turnWeightField - The name of the turn weight filed.
        weight - The new weight.
        Returns:
        The original weight if the update is successful, or the minimum value of the double data type otherwise.
      • getTurnWeightNames

        public java.lang.String[] getTurnWeightNames(java.lang.String networkDataName)
        

        Gets an array of field names of turn weights.

        Specified by:
        getTurnWeightNames in interface TransportationAnalyst
        Parameters:
        networkDataName - Used to uniquely identify the network dataset. It is one of elements of the array returned by getNetworkDataNames().
        Returns:
        The array of field names of turn weights.
      • getWeightNames

        public java.lang.String[] getWeightNames(java.lang.String networkDataName)
        

        Gets an array of weight field names.

        Specified by:
        getWeightNames in interface TransportationAnalyst
        Parameters:
        networkDataName - Used to uniquely identify the network dataset. It is one of elements of the array returned by getNetworkDataNames().
        Returns:
        The array of weight field names.
      • reloadModel

        public boolean reloadModel(java.lang.String networkDataName)
        

        Reloads the network model.

        Specified by:
        reloadModel in interface TransportationAnalyst
        Returns:
        Reloading succeeded or failed.
      • findConnectedEdgesFromEdges

        public FacilityAnalyst2DResult findConnectedEdgesFromEdges(int[] edgeIDs,
                                                          boolean connected,
                                                          boolean returnFeatures,
                                                          java.lang.String networkDataName)
        
        Description copied from interface: TransportationAnalyst
        Finds the connected edges for the edges specified with ID array. And the ID array of the connected edges will be returned.
        Specified by:
        findConnectedEdgesFromEdges in interface TransportationAnalyst
        Parameters:
        edgeIDs - The ID array of the specified edges.
        connected - Connected or unconnected. If set to true, it will return the connected edges; false, return the unconnected edges.
        returnFeatures - Whether to return features. If set to true, it will return features; false, doesn't return.
        Returns:
      • findConnectedEdgesFromNodes

        public FacilityAnalyst2DResult findConnectedEdgesFromNodes(int[] nodeIDs,
                                                          boolean connected,
                                                          boolean returnFeatures,
                                                          java.lang.String networkDataName)
        
        Description copied from interface: TransportationAnalyst
        Finds the connected edges for the nodes specified with ID array. And the ID array of the connected edges will be returned.
        Specified by:
        findConnectedEdgesFromNodes in interface TransportationAnalyst
        Parameters:
        nodeIDs - The iD array of the specified nodes.
        connected - Connected or unconnected. If set to true, it will return the connected edges; false, return the unconnected edges.
        returnFeatures - Whether to return features. If set to true, it will return features; false, doesn't return.
        Returns: