コード例 #1
0
ファイル: Astar.java プロジェクト: mkote/d505e15-p5-impl
  private Route reconstructPath() {
    FakeNode currentNode = endNode;

    Route route = new Route();
    while (currentNode != null) {
      if (!route.prependNode(currentNode.node)) {
        System.err.println("Detected circular reference! Aborting ......");
        throw new IllegalStateException("Detected circular reference!");
      }
      currentNode = currentNode.cameFrom;
    }

    cleanUp();

    return route;
  }