public class FindTSPPathsService
extends java.lang.Object
旅行商分析服务类。
该类负责将客户端指定的旅行商分析参数传递给服务端,并接收服务端返回的结果数据。
旅行商分析是路径分析的一种,它从起点开始(默认为用户指定的第一点)查找能够遍历所有途经点且花费最小的路径。旅行商分析也可以指定到达的终点,这时查找从起点能够遍历所有途经点最后到达终点,且花费最小的路径。
旅行商分析和最佳路径分析都是在网络中寻找遍历所有站点的最经济的路径,区别是在遍历网络所有站点的过程中对结点访问顺序不同。最佳路径分析必须按照指定顺序对站点进行访问,而旅行商分析是无序的路径分析。
该类负责将客户端指定的旅行商分析参数传递给服务端,并接收服务端返回的结果数据,将最终结果存放于 FindTSPPathsResult 类中。用户若需获取服务端返回的原始结果,需监听 FindTSPPathsEvent.PROCESS_COMPLETE 事件,该事件中即存有原始结果,又存有可在客户端显示的最终结果 FindMTSPPathsResult。
限定符和类型 | 类和说明 |
---|---|
static class |
FindTSPPathsService.FindTSPPathsEventListener
处理旅行商分析结果的监听器抽象类。
|
构造器和说明 |
---|
FindTSPPathsService(java.lang.String url)
构造函数。
|
限定符和类型 | 方法和说明 |
---|---|
FindTSPPathsResult |
getLastResult()
返回旅行商分析结果。
|
<T> void |
process(FindTSPPathsParameters<T> params, FindTSPPathsService.FindTSPPathsEventListener listener)
根据旅行商分析与服务端完成异步通讯,即发送分析参数,并通过实现FindTSPPathsEventListener监听器处理分析结果。
|
public FindTSPPathsService(java.lang.String url)
构造函数。
url
- 旅行商分析服务地址。public <T> void process(FindTSPPathsParameters<T> params, FindTSPPathsService.FindTSPPathsEventListener listener)
根据旅行商分析与服务端完成异步通讯,即发送分析参数,并通过实现FindTSPPathsEventListener监听器处理分析结果。
params
- 旅行商分析参数信息。listener
- 处理分析结果的FindTSPPathsEventListener监听器。public FindTSPPathsResult getLastResult()
返回旅行商分析结果。