diff --git "a/C++/codes/2024-07/\350\265\265\346\255\243\346\235\260/Astar/CMakeLists.txt" "b/C++/codes/2024-07/\350\265\265\346\255\243\346\235\260/Astar/CMakeLists.txt" new file mode 100644 index 0000000000000000000000000000000000000000..d308cc63472d65596cbcef13f6c864b2c03f6a83 --- /dev/null +++ "b/C++/codes/2024-07/\350\265\265\346\255\243\346\235\260/Astar/CMakeLists.txt" @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.10) +project(MyLargeProject) + +# 设置C++标准 +set(CMAKE_CXX_STANDARD 11) +# 添加全局包含目录 +include_directories(${PROJECT_SOURCE_DIR}/include) +# 包含子目录 +add_subdirectory(src) +add_subdirectory(test) + diff --git "a/C++/codes/2024-07/\350\265\265\346\255\243\346\235\260/Astar/doc/html/_astar_8h.html" "b/C++/codes/2024-07/\350\265\265\346\255\243\346\235\260/Astar/doc/html/_astar_8h.html" new file mode 100644 index 0000000000000000000000000000000000000000..6c3131fa5d7f95caf56206997497f25483f03177 --- /dev/null +++ "b/C++/codes/2024-07/\350\265\265\346\255\243\346\235\260/Astar/doc/html/_astar_8h.html" @@ -0,0 +1,129 @@ + + +
+ + + + +
+ My Project
+ 1.0
+
+ Astar
+ |
+
这个文件是A*算法的实现文件,主要实现了A*算法的搜索路径和得到路径的算法 +更多...
++类 | |
class | Astar |
这个文件是A*算法的实现文件,主要实现了A*算法的搜索路径和得到路径的算法
+
+ My Project
+ 1.0
+
+ Astar
+ |
+
+ My Project
+ 1.0
+
+ Astar
+ |
+
这是Graph类的头文件 +更多...
+#include "public_header.h"
+类 | |
class | Graph |
这是Graph类的头文件
+
+ My Project
+ 1.0
+
+ Astar
+ |
+
+ My Project
+ 1.0
+
+ Astar
+ |
+
这个文件定义了可视化类Visualization +更多...
++类 | |
class | Visualization |
可视化函数,我知道QT可以可视化,但是我没学过QT,最近实验室事情实在太多了,浅浅用终端代替一下 更多... | |
这个文件定义了可视化类Visualization
+包含了可视化函数Put_Visual()
+
+ My Project
+ 1.0
+
+ Astar
+ |
+
+ My Project
+ 1.0
+
+ Astar
+ |
+
CAstar | |
CGraph | |
CVisualization | 可视化函数,我知道QT可以可视化,但是我没学过QT,最近实验室事情实在太多了,浅浅用终端代替一下 |
+ My Project
+ 1.0
+
+ Astar
+ |
+
成员的完整列表,这些成员属于 Astar,包括所有继承而来的类成员
+Find_neighbors(const Point current, Graph &graph) | Astar | |
get_Path(const Point &end, const Point &start, Graph &graph, Visualization *vis=nullptr) | Astar | |
search_Path(const Point start, const Point end, Graph &graph) | Astar |
+ My Project
+ 1.0
+
+ Astar
+ |
+
+Public 成员函数 | |
void | search_Path (const Point start, const Point end, Graph &graph) |
这个函数是搜索路径的主函数,主要实现了A*算法的搜索路径算法 更多... | |
void | get_Path (const Point &end, const Point &start, Graph &graph, Visualization *vis=nullptr) |
这个函数是得到路径的主函数,主要实现了A*算法的得到路径算法 更多... | |
std::vector< Point > | Find_neighbors (const Point current, Graph &graph) |
std::vector< Astar::Point > Astar::Find_neighbors | +( | +const Point | +current, | +
+ | + | Graph & | +graph | +
+ | ) | ++ |
current | 当前节点 |
graph | 图结构 |
void Astar::get_Path | +( | +const Point & | +end, | +
+ | + | const Point & | +start, | +
+ | + | Graph & | +graph, | +
+ | + | Visualization * | +vis = nullptr |
+
+ | ) | ++ |
这个函数是得到路径的主函数,主要实现了A*算法的得到路径算法
+@parma end 终点坐标
start | 起点坐标 |
graph | 图结构 |
vis | 可视化类 |
void Astar::search_Path | +( | +const Point | +start, | +
+ | + | const Point | +end, | +
+ | + | Graph & | +graph | +
+ | ) | ++ |
这个函数是搜索路径的主函数,主要实现了A*算法的搜索路径算法
+start | 起点坐标 |
end | 终点坐标 |
graph | 图结构 |
+ My Project
+ 1.0
+
+ Astar
+ |
+
成员的完整列表,这些成员属于 Graph,包括所有继承而来的类成员
+Astar class | Graph | friend |
get_length() | Graph | |
get_Weight(int x, int y) | Graph | |
get_Width() | Graph | |
Graph(int w=4, int h=8) | Graph | |
set_Weight() | Graph | |
~Graph() (定义于 Graph) | Graph |
+ My Project
+ 1.0
+
+ Astar
+ |
+
+Public 成员函数 | |
+ | Graph (int w=4, int h=8) |
这个构造函数初始化图的宽和高 | |
+void | set_Weight () |
Set the Weight object | |
int | get_Width () |
Get the Width object 更多... | |
int | get_length () |
Get the length object 更多... | |
int | get_Weight (int x, int y) |
Get the Weight object 更多... | |
+友元 | |
+class | Astar |
声明了Graph类的友元类Astar | |
int Graph::get_length | +( | +) | ++ |
int Graph::get_Weight | +( | +int | +x, | +
+ | + | int | +y | +
+ | ) | ++ |
int Graph::get_Width | +( | +) | ++ |
+ My Project
+ 1.0
+
+ Astar
+ |
+
成员的完整列表,这些成员属于 Visualization,包括所有继承而来的类成员
+Put_Visual() | Visualization | |
Visualization(Graph *ptr) (定义于 Visualization) | Visualization | |
~Visualization() (定义于 Visualization) | Visualization |
+ My Project
+ 1.0
+
+ Astar
+ |
+
可视化函数,我知道QT可以可视化,但是我没学过QT,最近实验室事情实在太多了,浅浅用终端代替一下 + 更多...
+ +#include <Visual.h>
+Public 成员函数 | |
+ | Visualization (Graph *ptr) |
+void | Put_Visual () |
可视化函数,没有输入文件,输出到终端 | |
可视化函数,我知道QT可以可视化,但是我没学过QT,最近实验室事情实在太多了,浅浅用终端代替一下
+
+ My Project
+ 1.0
+
+ Astar
+ |
+
+ My Project
+ 1.0
+
+ Astar
+ |
+
+ My Project
+ 1.0
+
+ Astar
+ |
+
+ My Project
+ 1.0
+
+ Astar
+ |
+
+ My Project
+ 1.0
+
+ Astar
+ |
+
+ My Project
+ 1.0
+
+ Astar
+ |
+
文件在 test | 在 src 中引用 |
---|---|
test_case.cpp | Algorithm / Astar.h |
+ My Project
+ 1.0
+
+ Astar
+ |
+
+ My Project
+ 1.0
+
+ Astar
+ |
+
+ My Project
+ 1.0
+
+ Astar
+ |
+
+ My Project
+ 1.0
+
+ Astar
+ |
+
+ My Project
+ 1.0
+
+ Astar
+ |
+
+ My Project
+ 1.0
+
+ Astar
+ |
+
+ My Project
+ 1.0
+
+ Astar
+ |
+
+ My Project
+ 1.0
+
+ Astar
+ |
+
+ My Project
+ 1.0
+
+ Astar
+ |
+
+ My Project
+ 1.0
+
+ Astar
+ |
+
+ My Project
+ 1.0
+
+ Astar
+ |
+
+文件 | |
文件 | Astar.h [代码] |
这个文件是A*算法的实现文件,主要实现了A*算法的搜索路径和得到路径的算法 | |
+ My Project
+ 1.0
+
+ Astar
+ |
+
+ My Project
+ 1.0
+
+ Astar
+ |
+
+ My Project
+ 1.0
+
+ Astar
+ |
+
+ My Project
+ 1.0
+
+ Astar
+ |
+
+ My Project
+ 1.0
+
+ Astar
+ |
+
+ My Project
+ 1.0
+
+ Astar
+ |
+
+ My Project
+ 1.0
+
+ Astar
+ |
+
本页将向您解释如何理解由 doxygen 生成的图.
+考虑如下例子:
结果将会生成以下图:
+上图中的矩形有如下意义:
+箭头有如下意义:
+
+ My Project
+ 1.0
+
+ Astar
+ |
+
+ My Project
+ 1.0
+
+ Astar
+ |
+
这是主函数文件 +更多...
++函数 | |
int | main () |
这是主函数文件
+ +这里简单实现了一个A*算法的路径搜索,并用可视化工具Visualization来展示搜索过程。
+int main | +( | +) | ++ |
这里为了方便起见我直接写了缺省值为4和8,但是实际上可以画任意大的图
+