@ 16. 1 ~ 17. 1/게임 AI 관련
-
A* 알고리즘@ 16. 1 ~ 17. 1/게임 AI 관련 2015. 5. 30. 13:39
//IDIM * JDIM 배열 8*6 배열 const int IDIM = 8; const int JDIM = 6; const int NDIR = 4; const int iDir[NDIR] = { 1, 0, -1, 0 }; const int jDir[NDIR] = { 0, 1, 0, -1 }; int squares[IDIM][JDIM]; //닫힌목록 int clostNodes[IDIM][JDIM]; //열린목록 int openNodes[IDIM][JDIM]; //방향표시 맵..동쪽 0, 북쪽 1, 서쪽 2, 남쪽 3 int dirMap[IDIM][JDIM]; //x,y좌표를 대신하는것...row열과 col행으로.. struct Location { int row, col; Location() { row = ..
-
다익스트라 알고리즘@ 16. 1 ~ 17. 1/게임 AI 관련 2015. 5. 24. 23:27
Graph_SearchDijkstra cpp파일 #include"Graph_SearchDijkstra.h" Graph_SearchDijkstra::Graph_SearchDijkstra(string str) : m_fs(str.c_str(), ios::in) { if (!m_fs.is_open()) { cout m_nodeNum; m_fs >> m_edgeNum; m_vW.resize(m_nodeNum); m_vS.resize(m_nodeNum); } Graph_SearchDijkstra::~Graph_SearchDijkstra() { m_vW.clear(); m_vS.clear(); cout from; m_fs >> to; m_fs >> cost; from -= 1; to -= 1; temp.SetFro..