资源简介
a*启发式搜索算法的matlab仿真程序

代码片段和文件信息
// STL A* Search implementation
// Copyright 2001 Justin Heyes-Jones
// used for text debugging
#include
#include
#include
#include
#include
#include
// stl includes
#include
#include
#include
using namespace std;
// fast fixed size memory allocator used for fast node memory management
#include “fsa.h“
// Fixed size memory allocator can be disabled to compare performance
// Uses std new and delete instead if you turn it off
#define USE_FSA_MEMORY 1
// disable warning that debugging information has lines that are truncated
// occurs in stl headers
#pragma warning( disable : 4786 )
#define DEBUG_LISTS 0
#define DEBUG_LIST_LENGTHS_ONLY 0
// Global data
// The world map
const int MAP_WIDTH = 20;
const int MAP_HEIGHT = 20;
int NumofNodes;
int AvgDist;
/*
int mymap[ MAP_WIDTH * MAP_HEIGHT ] =
{
// 0001020304050607080910111213141516171819
11111111111111111111 // 00
19919911191999991111 // 01
11911999191919199911 // 02
19911999191919199911 // 03
11111199191911119911 // 04
11119111191111911111 // 05
19999111111999911111 // 06
11999999911199999991 // 07
19111111111911111111 // 08
11199999991199999991 // 09
11111191191111111111 // 10
19999919191999991111 // 11
19191999191919199911 // 12
19191999191919199911 // 13
19111199191911119911 // 14
11119111191111911111 // 15
19999111111999911111 // 16
11999999911199999991 // 17
19111111111911111111 // 18
11999999991199999911 // 19
};
*/
//let‘s just assume 5 nodes first
//float coordination[5][2]={{00} {10} {20} {30} {40}};
//int connect[5][5]={{0 1 0 0 0} {1 0 1 0 0} {0 1 0 1 0} {0 0 1 0 1} {0 0 0 1 0}};
//float coordination[4][2]={{00} {10} {0 1} {1 1}};
//int connect[4][4]={{0 1 1 0} {1 0 0 1} {1 0 0 1} {0 1 1 0}};
//double coordination[] = {0 0 1 0 0 1 1 1};
//double connect[]={0 1 1 0 1 0 0 1 1 0 0 1 0 1 1 0};
double *coordination;
double *connect;
double GetX(int id)
{
//return coordination[id][0];
return *(coordination + id*2);
}
double GetY(int id)
{
//return coordination[id][1];
return *(coordination + id*2 + 1);
}
// map helper functions
double GetMap(int x int y)
{
//return connect[x][y];
return *(connect + x*NumofNodes + y);
}
// The AStar search class. UserState is the users state space type
template class AStarSearch
{
public
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 27278 2005-06-13 18:08 Astar.cpp
文件 24576 2005-08-12 14:43 Astar.dll
文件 3370 2005-08-12 14:28 dijkstra.m
文件 4978 2001-12-02 19:29 fsa.h
文件 2693 2005-08-12 14:46 Spath_test.m
文件 16069 2005-06-13 01:41 stlastar.h
- 上一篇:Turbo码Matlab仿真程序
- 下一篇:iwssim源程序
相关资源
- Matlab路面裂缝识别69319
- 高灵敏度GPS接收机MATLAB仿真,附捕获
- 基于MATLAB的质点弹道计算与外弹道优
- 阵列天线的matlab仿真
- MATLAB 经典程序源代码大全
- MATLAB小波软阈值去噪代码33473
- 天线阵的波束形成在MATLAB仿真程序及
- 非线性SVM算法-matlab实现
- 《MATLAB 智能算法超级学习手册》-程序
- 组合导航matlab程序
- 读取txt文件内容matlab代码实现
- Matlab实现基于相关的模板匹配程序
- matlab优化工具箱讲解
- 基于MATLAB的快速傅里叶变换
- 光纤传输中的分布傅立叶算法matlab实
- 基于matlab的图像处理源程序
- matlab 椭圆拟合程序
- 算术编码解码matlab源代码
- optical_flow 光流法 matlab 实现程序
- 引导图像滤波器 Matlab实现
- 分形几何中一些经典图形的Matlab画法
- OFDM系统MATLAB仿真代码
- SVM工具箱(matlab中运行)
- 图像小波变换MatLab源代码
- LU分解的MATLAB实现
- 冈萨雷斯数字图像处理matlab版(第三
- 替代数据法的matlab程序
- 用matlab实现的多站定位系统性能仿真
- 通过不同方法进行粗糙集属性约简m
- k近邻算法matlab实现
评论
共有 条评论