Initial Dijkstra algorithm for the map, but doesn't quite work right. The walls in the wall_map are not accounted for in the algorithm.
This commit is contained in:
parent
d7b1cf0bf9
commit
4d748d1f48
5 changed files with 143 additions and 1 deletions
17
map.hpp
Normal file
17
map.hpp
Normal file
|
@ -0,0 +1,17 @@
|
|||
#pragma once
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
|
||||
struct Pair {
|
||||
size_t j = 0;
|
||||
size_t i = 0;
|
||||
};
|
||||
|
||||
typedef std::vector<Pair> PairList;
|
||||
typedef std::vector<int> MatrixRow;
|
||||
typedef std::vector<MatrixRow> Matrix;
|
||||
|
||||
void dump_map(Matrix &map);
|
||||
void add_neighbors(Matrix &closed, size_t j, size_t i);
|
||||
|
||||
Matrix dijkstra_map(Matrix &input_map, Matrix &walls_map, int limit=0);
|
Loading…
Add table
Add a link
Reference in a new issue