84 if (routeManager ==
null) {
85 System.err.println(
"RouteManager not initialized");
89 if (routeListener ==
null)
return;
93 routeManager.addRouteListener(routeListener);
98 routeManager.setGraphTag(
"main");
103 String currentGraphTag = routeManager.getGraphTag();
104 System.out.println(
"Current graph tag: " + currentGraphTag);
109 List<String> graphTags = routeManager.getGraphTags();
110 System.out.println(
"Available graph tags: " + graphTags);
121 RoutePath routePath = routeManager.makeRoute(startLocationPoint, endLocationPoint);
122 System.out.println(
"Route created with length: " + routePath.getLength() +
" meters");
127 List<LocationPoint> destinations =
new ArrayList<>();
130 List<RoutePath> routePaths = routeManager.makeRoutes(startLocationPoint, destinations);
131 System.out.println(
"Created " + routePaths.size() +
" routes");
136 routeManager.setTarget(endLocationPoint);
142 routeManager.addTarget(additionalTarget);
147 routeManager.cancelTarget();
152 routeManager.clearTargets();
160 for (
int i = 0; i < paths.size(); i++) {
162 System.out.println(
"=== Route Path " + (i + 1) +
" ===");
166 double length = path.getLength();
167 System.out.println(
"Route length: " + length +
" meters");
172 List<LocationPoint> points = path.getPoints();
173 System.out.println(
"Route has " + points.size() +
" points");
174 for (
int j = 0; j < points.size(); j++) {
181 List<RouteEvent> events = path.getEvents();
182 System.out.println(
"Route has " + events.size() +
" events");
183 for (
int j = 0; j < events.size(); j++) {
191 if (headPath !=
null) {
192 System.out.println(
"Head path length: " + headPath.getLength() +
" meters");
199 if (tailPath !=
null) {
200 System.out.println(
"Tail path length: " + tailPath.getLength() +
" meters");
344 System.out.println(
"=== Route Planning Simulation ===");
346 if (routeManager ==
null) {
351 List<LocationPoint> targets =
new ArrayList<>();
358 routeManager.setTarget(targets.get(0));
361 System.out.println(
"Set target 1: " + targets.get(0));
365 }
catch (InterruptedException e) {
366 Thread.currentThread().interrupt();
371 for (
int i = 1; i < targets.size(); i++) {
372 routeManager.addTarget(targets.get(i));
373 System.out.println(
"Added target " + (i + 1) +
": " + targets.get(i));
376 }
catch (InterruptedException e) {
377 Thread.currentThread().interrupt();
384 routeManager.cancelTarget();
385 System.out.println(
"Cancelled current target");
390 }
catch (InterruptedException e) {
391 Thread.currentThread().interrupt();
396 routeManager.clearTargets();
397 System.out.println(
"Cleared all targets");