摘要: 1 #ifndef __BFS__H 2 #define __BFS__H 3 4 #include "AIDefine.h" 5 #include 6 7 class BFS 8 { 9 private:10 BFS();11 public:12 static bool find(const PointI &size, const PointI &start, const PointI &end, AI_VisitFun visitFun, Path **path = NULL,13 EFindType findType = EFIND_TYPE8 阅读全文
posted @ 2013-11-23 01:30 liusijian 阅读(391) 评论(0) 推荐(0) 编辑
摘要: 1 #ifndef __BSTAR__H 2 #define __BSTAR__H 3 4 #include "AIDefine.h" 5 #include 6 7 class BStar 8 { 9 private: 10 BStar(); 11 public: 12 static bool find(const PointI &size, const PointI &start, const PointI &end, AI_VisitFun visitFun, Path **path = NULL) 13 { 14 if(s... 阅读全文
posted @ 2013-11-23 01:28 liusijian 阅读(1005) 评论(0) 推荐(0) 编辑
摘要: 1 #ifndef __ASTAR__H 2 #define __ASTAR__H 3 4 #include "AIDefine.h" 5 #include "../Common/PriorityQueue.h" 6 7 class AStar 8 { 9 private: 10 AStar(); 11 public: 12 static bool find(const PointI &size, const PointI &start, const PointI &end, AI_VisitFun visitFun, Path 阅读全文
posted @ 2013-11-23 01:26 liusijian 阅读(413) 评论(0) 推荐(0) 编辑
摘要: 1 #include "AIDefine.h"2 3 PointI AI_FindHelpPoint[8] = {PointI(-1,0),PointI(0,-1),PointI(1,0),PointI(0,1),PointI(-1,-1),PointI(1,-1),PointI(1,1),PointI(-1,1)}; 阅读全文
posted @ 2013-11-23 01:25 liusijian 阅读(244) 评论(0) 推荐(0) 编辑
摘要: 1 #ifndef __AIDEFINE__H 2 #define __AIDEFINE__H 3 4 #include 5 #include "../Common/Path.h" 6 7 #define MATH_SQRT2 1.4142135623731f 8 enum EFindType 9 {10 EFIND_TYPE4 = 4,//must be 411 EFIND_TYPE8 = 8//must be 812 };13 extern PointI AI_FindHelpPoint[8];14 typedef float (*AI_DitanceFun)(in.. 阅读全文
posted @ 2013-11-23 01:23 liusijian 阅读(261) 评论(0) 推荐(0) 编辑
摘要: 1 #ifndef __PRIORITYQUEUE__H 2 #define __PRIORITYQUEUE__H 3 4 #include 5 6 template, typename Container = std::deque > 7 class PriorityQueue 8 { 9 public:10 bool empty() const11 {12 return (m_container.empty());13 }14 15 unsigned int size() const16 {17 return ... 阅读全文
posted @ 2013-11-23 01:21 liusijian 阅读(283) 评论(0) 推荐(0) 编辑
摘要: 1 #ifndef __PATH__H 2 #define __PATH__H 3 4 #include 5 #include "Point.h" 6 7 class Path 8 { 9 public:10 typedef std::list PathList;11 typedef PathList::const_iterator Iterator;12 public:13 Path():m_find(false),m_step(0),m_dis(0.0f){}14 Path(bool find, float dis):m_find(find),m_s... 阅读全文
posted @ 2013-11-23 01:20 liusijian 阅读(312) 评论(0) 推荐(0) 编辑
摘要: 1 #ifndef __POINT__H 2 #define __POINT__H 3 4 template 5 struct Point 6 { 7 Point():x(0),y(0){} 8 Point(const T _x, const T _y):x(_x),y(_y){} 9 inline void set(const int _x, const int _y){x = _x; y = _y;}10 inline void set(const Point &point){x = point.x; y = point.y;}11 T x;12... 阅读全文
posted @ 2013-11-23 01:16 liusijian 阅读(329) 评论(0) 推荐(0) 编辑
摘要: 程序需要额外的第三方库,如:A.swf和B.swf都需要一样的第三方裤(C.swc),但flash编译后A.swf和B.swf都完全包含了C.swc,增加了swf文件大小。动态加载可以给swf瘦身。swc库文件其实是个压缩文档,把swc改成zip文件可以看到里面包含了library.swf和catalog.xml两个文件。(完全可以把library.swf解压出来像加载普通swf文件一样处理)程序需要用到FZip第三方库,要编译通过在这里下载。http://codeazur.com.br/lab/fzip/ 1 package 2 { 3 import deng.fzip.FZip;... 阅读全文
posted @ 2013-02-18 22:50 liusijian 阅读(623) 评论(0) 推荐(0) 编辑
摘要: MPI(MPI是一个标准,有不同的具体实现,比如MPICH等)是多主机联网协作进行并行计算的工具OpenMP是针对单主机上多核/多CPU并行计算而设计的工具,换句话说,OpenMP更适合单台计算机共享内存结构上的并行计算。MPI只是对循环进行并行化;任何生产者-消费者类情况不得不明确地用pthreads来处理。OpenCL类似于OpenGL,是由整个业界共同制定的开放式标准,能够对硬件底层直接进行操作,相对来说比较灵活,也很强大,但开发难度较高;DirectCompute类似于DirectX,是由微软主导的通用计算API,与Windows集成并偏向于消费领域,在易用性和兼容性方面做得更出色一些 阅读全文
posted @ 2012-10-22 17:46 liusijian 阅读(447) 评论(0) 推荐(0) 编辑