| | |
| | | // 执行算法 |
| | | Assignment solution = routing.solveWithParameters(searchParameters); |
| | | if(solution ==null){ |
| | | log.error("规划结束=============未找到最优路线!" ); |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"未找到最优路线!"); |
| | | } |
| | | // 打印路线 |
| | | resultSolution(data, routing, manager, solution); |
| | | long end =System.currentTimeMillis(); |
| | | log.error("规划结束=============耗时=========="+(end -start)+"(ms)"+(end -start)/1000 +"s"+(end -start)/60/1000 +"m"); |
| | | log.error("规划结束=============耗时=========="+(end -start)+"(ms)"+(end -start)/1000 +"s"+(end -start)/60/1000 +"m"); |
| | | } |
| | | static void resultSolution( DataModel data, RoutingModel routing, RoutingIndexManager manager, Assignment solution) { |
| | | long maxRouteDistance = 0; |