-1

現在地からポイントまでの最短経路を見つける必要がある屋内ナビゲーション システムを実装しようとしています。

私が到達したこと: ダイクストラのアルゴリズム/ヒップスターと、重みのある 4 つのノードを定義するテスト コードを使用して、ソースから宛先への最短ルートを見つけようとします。

ノードとして定義されていないマップ上のポイントにいて、ノードである場合とそうでない場合があるポイントに移動したい場合、そのような場合、最短パスを見つける方法は?

私が使用している現在のテストコード:

package indoornav.shortestpath;

import java.util.List;

import es.usc.citius.hipster.algorithm.Hipster;
import es.usc.citius.hipster.graph.GraphBuilder;
import es.usc.citius.hipster.graph.GraphSearchProblem;
import es.usc.citius.hipster.graph.HipsterDirectedGraph;
import es.usc.citius.hipster.model.problem.SearchProblem;

public class Client3 {
    public static void main(String[] args)
    {
        HipsterDirectedGraph<String,Double> graph = 
                GraphBuilder.<String,Double>create()
                 .connect("A").to("D").withEdge(10d)
                 .connect("A").to("C").withEdge(12d)
                 .connect("C").to("A").withEdge(12d)
                 .connect("C").to("B").withEdge(10d)
                 .connect("B").to("D").withEdge(10d)
                 .connect("B").to("C").withEdge(10d)
                 .connect("D").to("A").withEdge(10d)
                 .connect("D").to("B").withEdge(10d)

                 .createDirectedGraph();

            // Create the search problem. For graph problems, just use
            // the GraphSearchProblem util class to generate the problem with ease.
            SearchProblem p = GraphSearchProblem
                                       .startingFrom("A")
                                       .in(graph)
                                       .takeCostsFromEdges()
                                       .build();

            // Search the shortest path from "A" to "F"
            System.out.println(Hipster.createDijkstra(p).search("B"));
    }
}

    enter code here
4

1 に答える 1