路径规划算法测试工具

5

有人知道用于路径查找算法测试的工具吗?我能在2D网格上测试我的自己编写的路径查找算法。 类似这个http://topfat.blogspot.com/,但是我需要写和运行我的自己的算法。我可以使用任何编程语言进行调整。

1个回答

0
你有检查过寻路算法工具的源代码吗?我是其中一名开发人员,这个工具是开源的(Java)。例如,你的算法应该实现的接口是:
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);

你可以在这个类中添加你的算法 (http://code.google.com/p/topfat/source/browse/trunk/src/algorithms/PathFindingAlgorithms.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 Code http://code.google.com/p/topfat/ 进行检出。如果您想提交一些内容,我们也可以为您添加写入权限。


我正在大学学习,并参与与路径查找算法相关的项目。我在互联网上搜索了类似的程序,但没有找到。所以我问过别人,也许已经有这样的程序了。现在我只是在检查可用的选项和替代方案。 - macro

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接