worked on signal-strength-estimation

add this information to grid nodes
evaluate this information
new test-cases
This commit is contained in:
2016-07-15 15:29:07 +02:00
parent 34e52cd7f0
commit 99ee95ce7b
21 changed files with 568 additions and 26 deletions

View File

@@ -29,16 +29,16 @@ TEST(AStar, build) {
// const GP* getNeighbor(const GP& node, const int idx) const {return &grid.getNeighbor(node, idx);}
const std::vector<GP>& getAllNodes() const {return grid.getNodes();}
decltype(grid.neighbors(GP())) getNeighbors(const GP& node) const {return grid.neighbors(node);}
float getWeightBetween(const GP& n1, const GP& n2) const {return ((Point3)n1 - (Point3)n2).length();}
float getWeightBetween(const GP& n1, const GP& n2) const {return (n1.inCentimeter() - n2.inCentimeter()).length();}
float getHeuristic(const GP& n1, const GP& n2) const {return std::abs(n1.x_cm - n2.x_cm) + std::abs(n1.y_cm - n2.y_cm);}
} tmp(grid);
AStar<GP> nav;
std::vector<const GP*> vec = nav.get(&grid[0], &grid[4], tmp);
// std::vector<const GP*> vec = nav.get(grid[0], grid[4], tmp);
for (const GP* g : vec) {
std::cout << g << std::endl;
}
// for (const GP* g : vec) {
// std::cout << g << std::endl;
// }
}

View File

@@ -27,7 +27,7 @@ TEST(Dijkstra, build) {
TMP(Grid<GP>& grid) : grid(grid) {;}
int getNumNeighbors(const GP& node) const {return node.getNumNeighbors();}
const GP* getNeighbor(const GP& node, const int idx) const {return &grid.getNeighbor(node, idx);}
float getWeightBetween(const GP& n1, const GP& n2) const {return ((Point3)n1 - (Point3)n2).length();}
float getWeightBetween(const GP& n1, const GP& n2) const {return (n1.inCentimeter() - n2.inCentimeter()).length();}
} tmp(grid);
Dijkstra<GP> d;
@@ -94,7 +94,7 @@ void dijkstra(Grid<GP>& grid) {
TMP(Grid<GP>& grid) : grid(grid) {;}
int getNumNeighbors(const GP& node) const {return node.getNumNeighbors();}
const GP* getNeighbor(const GP& node, const int idx) const {return &grid.getNeighbor(node, idx);}
float getWeightBetween(const GP& n1, const GP& n2) const {return ((Point3)n1 - (Point3)n2).length();}
float getWeightBetween(const GP& n1, const GP& n2) const {return (n1.inCentimeter() - n2.inCentimeter()).length();}
} tmp(grid);
Dijkstra<GP> d;