2012-04-18 3 views
4

誰でも知っている、経路探索アルゴリズムテスト用のツール。 2dグリッド上でアルゴリズムを見つけることができました。 このようなものhttp://topfat.blogspot.com/ しかし、どこで自分のアルゴリズムを書いて実行することができますか。 プログラミング言語を使用している可能性があります。 自分のコードをほぼすべてのプログラミング言語に合わせることができます。経路探索アルゴリズムテスト用ツール

答えて

1

Path Findingアルゴリズムのツールのソースコードを確認しましたか?私は開発者の一人で、ツールはオープンソース(Java)です。たとえば、あなたのアルゴリズムが実装すべきインタフェースは、あなたのアルゴリズム(http://code.google.com/p/topfat/source/browse/trunk/src/algorithms/PathFindingAlgorithmsを追加

public interface PathFindingAlgorithm { 

    /** 
    * Method for finding path from given start point to goal point 
    * using Map object. Found path (if any) depends on path finding algorithm 
    * class that overrides this method. 
    * 
    * @param start the point where the search begins 
    * @param goal the goal point 
    * @param map Map object the path finding algorithm uses 
    * @return SearchResult object containing path and possibly other relevant information 
    * about the search and <code>null</code> if no path is found. 
    */ 
    public SearchResult findPath(Point start, Point goal, Graph graph); 

クラスです。 java):

public class PathFindingAlgorithms { 

    private Vector<PathFindingAlgorithm> algorithms; 

    public PathFindingAlgorithms() { 
      this.algorithms = new Vector<PathFindingAlgorithm>(); 
      addAlgorithm(new AStarAlgorithm()); 
      addAlgorithm(new DijkstraStyleAlgorithm()); 
    } 

    public Vector<PathFindingAlgorithm> getAlgorithms() { 
      return algorithms; 
    } 

    public void addAlgorithm(PathFindingAlgorithm algorithm) { 

      if (! this.algorithms.contains(algorithm)) { 
        this.algorithms.add(algorithm); 
      } 

    } 

    public void removeAlgorithm(PathFindingAlgorithm algorithm) { 
      this.algorithms.remove(algorithm); 
    } 

GUIに必要なものがすべて追加されているかどうかは正確にはわかりません。数年前にこれをやったので、コードは完璧ではありません。このアプリケーションの最も単純なケースはDijkstraです。より複雑なものが必要な場合は、A *をチェックしてください。

Googleコードhttp://code.google.com/p/topfat/からチェックアウトすることができます。あなたがコミットしたいことをした場合、私たちはあなたへの書き込み許可を追加することもできます。

+0

私は大学で勉強しており、経路発見アルゴリズムに関連するプロジェクトで働いています。私はインターネットのようなプログラムを探して見つけられませんでした。だから私はすでにそのようなプログラムがあるかもしれないと尋ねた。今、私は利用可能なオプションと代替案をチェックしています。 – macro

関連する問題