Class TransportationAnalystResult
- java.lang.Object
-
- com.supermap.analyst.networkanalyst.TransportationAnalystResult
-
- Direct Known Subclasses:
- ServiceAreaResult
public class TransportationAnalystResult extends java.lang.Object
The TransportationAnalystResult class.
Through this class you can get the Route set, node ID set, edge set, path table set, stop ID set, weight set or cost of each stop. Using these settings, you can get the analysis result of the optimal path, traveling salesmen, logistics and closest facility.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description void
dispose()
Disposes the resources occupied by the object.int[][]
getEdges()
Returns the edges dataset of the analysis result.int[][]
getNodes()
Returns the nodes dataset of the analysis result.PathGuide[]
getPathGuides()
Returns the path guides.GeoLineM[]
getRoutes()
Returns the routes dataset of the analysis result that is the dataset of theGeoLineM
object.int[][]
getStopIndexes()
Returns the 2D array of the stop indexes which reflects the order of the stops after analysis.double[][]
getStopWeights()
Returns the cost (weight) between the stops after sorting the stops according to the index.double[]
getWeights()
Returns the weight array represented the cost.
-
-
-
Method Detail
-
dispose
public void dispose()
Disposes the resources occupied by the object. After calling this method, this object will not be usable.
-
getRoutes
public GeoLineM[] getRoutes()
Returns the routes dataset of the analysis result that is the dataset of theGeoLineM
object. Note: TheGeoLineM
property of theGeoLineM
class must be set as true so that the analysis results can contain the routes dataset; otherwise, it is a null array.The returned value represents different meanings in different analysis.
- FindPath() and FindTSPPath(): There will be always only one result route.
- FindClosestFacility(): The count of result routes is identical to the facility node's number.
- FindMTSPPath(): If the delivery mode is optimized each delivery center, the count of the result routes is identical to the number of supply centers. If it is the least total cost mode, the count of the result routes may be less than the number of supply centers.
- FindServiceArea(): This array stores the specified order according to the centers and the routes (partially) covered by each service area. The elements' orders of the array which is obtained from the method of the service area analysis result is corresponding to the specified orders of the centers. The element's value is the number of the centers (partially) covered by the service area. You can know the corresponding routes of each service area with the array.
- Returns:
- Gets the set of the route objects.
-
getNodes
public int[][] getNodes()
Returns the nodes dataset of the analysis result. Note: ThesetNodesReturn
property of thesetNodesReturn
object must be set as true so that the analysis results can contain the nodes dataset; otherwise, it is a null array.The returned value represents different meanings in different analysis.
- Optimal path analysis () and traveling salesmen analysis (): As the analysis result only have one path, the one-dimensional length of the array is 1, and the 2D elements are the ID of the edges passed by the path.
- Closest Facility (
findClosestFacility
andfindClosestFacility
): As the number of the paths in the result is identical with the number of closest facilities, the one-dimensional length of the array is the number of the facility points in the result, and the 2D elements are the ID of the edges passed by each path. - Multiple traveling salesmen analysis (
findMTSPPath
andfindMTSPPath
): The one-dimensional length of the array is the number of centers involved in the delivery, in which each center is corresponding to a path, and the 2D elements are the ID of the nodes passed by each path. Note: If the delivery mode is optimized each delivery center, all the centers will be involved in the delivery; if it is the least total cost mode, the number of the centers involved in the delivery may be less than the number of the specified centers. - Service area analysis (): The one-dimensional length of the array is the number of service centers, and the 2D elements are the ID of the nodes covered by the service area.
- Returns:
- The ID collection of the nodes passed by the analysis result path.
-
getEdges
public int[][] getEdges()
Returns the edges dataset of the analysis result. Note: The property of the object must be set as true so that the analysis results can contain the edges dataset; otherwise, it is a null array.The returned value represents different meanings in different analysis.
- Optimal path analysis (
findPath
) and traveling salesmen analysis (): As the analysis result only have one path, the one-dimensional length of the array is 1, and the 2D elements are the ID of the edges passed by the path. - Closest Facility (
findClosestFacility
andfindClosestFacility
): As the number of the paths in the result is identical with the number of closest facilities, the one-dimensional length of the array is the number of the facility points in the result, and the 2D elements are the ID of the edges passed by the path. - Multiple traveling salesmen analysis (
findMTSPPath
andfindMTSPPath
): The one-dimensional length of the array is the number of centers involved in the delivery, in which each center is corresponding to a path, and the 2D elements are the ID of the edges passed by each path. Note: If the delivery mode is the optimal mode in each delivery center, all the centers will be involved in the delivery; if it is the least cost mode, the number of the centers involved in the delivery may be less than the number of the specified centers. - Service area analysis (
findServiceArea
): The one-dimensional length of the array is the number of service centers, and the 2D elements are the ID of the edges (partially) covered by the service area.
- Returns:
- The collection of the edges passed by the analysis result path.
- Optimal path analysis (
-
getStopIndexes
public int[][] getStopIndexes()
Returns the 2D array of the stop indexes which reflects the order of the stops after analysis. Note: The property of the object must be set as true so that the analysis results can contain the stop-index dataset; otherwise, it is a null array.The returned value represents different meanings in different analysis.
- Optimal Path Analysis(
findPath
): - TSP (
findTSPPath
): - MTSP (
findMTSPPath
,findMTSPPath
):
The analysis result only have one path, so the one-dimensional length of the array is 1, and the 2D elements denote the orders of the stops passed by the result path:
Node mode: If the node ID of the array we set is 1, 3, 5, as the result order of passed nodes ID should be the same to the node order we set, so the value of the 2D elements will be 0, 1, 2, i.e., the node index of analysis order in the initial node array.
Coordinate points mode: If the specified coordinate points we set are Pnt1, Pnt2, Pnt3, as the result order of passed points is Pnt1, Pnt2, Pnt3, so the value of the 2D elements will be 0, 1, 2, i.e., the node index of analysis order in the initial node array.
The analysis result only have one path, so the one-dimensional length of the array is 1, and the 2D elements denote the orders of the stops passed by the result path:
Node mode: If the node ID of the array we set is 1, 3, 5, but the result order is 3, 5, 1, then the value of the 2D elements will be 1, 2, 0, i.e., the nodes index of the analysis order in the initial node array.
Coordinate points mode: If the specified coordinate points are Pnt1, Pnt2, Pnt3, but the result order is Pnt2, Pnt3, Pnt1, as the result order of passed points is Pnt1, Pnt2, Pnt3, then the value of the 2D elements will be 1, 2, 0, i.e., the coordinate points index of the analysis order in the initial coordinate points array.
It is similar with the traveling salesmen analysis. The one-dimensional length of the array is the number of centers involved in the delivery. The meanings of the 2D elements are identical to the traveling salesmen analysis, which denote the order of the centers passed by each path. Note: If the delivery mode is optimizing each delivery center, all the centers will be involved in the delivery; if it is the least total cost mode, the number of the centers involved in the delivery may be less than the number of the specified centers.
For the closest facility analysis(
findClosestFacility
method), the method is invalid.- Returns:
- The array of the site index.
- Optimal Path Analysis(
-
getStopWeights
public double[][] getStopWeights()
Returns the cost (weight) between the stops after sorting the stops according to the index. It has the same unit with the weight field of the object specified the property of the object.This method can get the cost between stops, which are the nodes or coordinate points involved in the analysis. The order of the stops related to the weight that is gotten by the method is consistent with the stop index gotten by the
getStopIndexes
method. But you need to pay attention on the tiny differences between different functions. E.g.,- Optimal path analysis (
findPath
): As the analysis result only have one path, the one-dimensional length of the array is 1. If it is specified to pass the point 1, 2, 3, then the values of the array elements are the cost from 1 to 2, and the cost from 2 to 3. - Traveling salesmen analysis (
findTSPPath
): As the analysis result only have one path, the one-dimensional length of the array is 1. If it is specified to pass the point 1, 2, 3, and the stops' index is 1, 0, 2, then the values of the 2D elements are the cost from 2 to 1, and the cost from 1 to 3. - Multiple traveling salesmen analysis (
findMTSPPath
,findMTSPPath
method): The analysis result may include multiple paths, so the one-dimensional length of the array is the number of the paths, and the 2D elements are the cost between the stops passed by the path. But note that the stops of MTSP include the center point, and the start/end point is the center point. For example, a result path begins from the stop 1, passes the stops 2, 3, 4, and the corresponding index is 1, 2, 0, then the weights of the stops are the cost from 1 to 3, from 3 to 4, from 4 to 2, and from 2 to 1.
For the closest facility analysis( method), the method is invalid.
- Returns:
- The weight of stops to be passed.
- Optimal path analysis (
-
getPathGuides
public PathGuide[] getPathGuides()
Returns the path guides. Note: The method of the object must be set as true so that the analysis results can contain the path guides; otherwise, it is a null array.Note: Only when the
isPathGuidesReturn
method of theTransportationAnalystParameter
object is set to true, the path guide collection can be obtained from the analysis.- Returns:
- The path guide collection.
-
getWeights
public double[] getWeights()
Returns the weight array represented the cost. It has the same unit with the weight field of the object specified the property of the object.The returned value represents different meanings in different analysis.
- Optimal path analysis (
findPath
) and traveling salesmen analysis (findTSPPath
): Since the analysis only has one result route, there is only one weight value which is the total cost of the path. - Find closest facility (
findClosestFacility
,findClosestFacility
method): The number of weight value is identical to the count of the facility nodes. Each element denotes the total cost from the event point to the facility point. - Multiple traveling salesmen analysis (
findMTSPPath
,findMTSPPath
method): The number of weight value is identical to the count of the delivery centers in the analysis result. Each element denotes the total cost of the corresponding center. Note: If the delivery mode is optimizing each delivery center, all the centers will be involved in the delivery; if it is the least total cost mode, the number of the centers involved in the delivery may be less than the number of the specified centers.
- Returns:
- The weight array of the cost.
- Optimal path analysis (
-
-