Advertisement
Litigare

Untitled

Jun 16th, 2021
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.33 KB | None | 0 0
  1. #ifndef __ASTAR_H__
  2. #define __ASTAR_H__
  3.  
  4. #include <vector>
  5. #include <functional>
  6. #include <set>
  7.  
  8. #include "AStarMPICommunication.h"
  9. #include "Coordinate.h"
  10. #include "Node.h"
  11. #include "NodeSet.h"
  12. #include "HeuristicFunction.h"
  13. #include "CoordinateList.h"
  14.  
  15. class AStar
  16. {
  17. private:
  18.     HeuristicFunction heuristic;
  19.     CoordinateList direction, walls;
  20.     Coordinate worldSize;
  21.  
  22.     Coordinate start;
  23.     Coordinate end;
  24.  
  25.     int directions;
  26.  
  27.     char** map;
  28.     char wallSymbol;
  29.     char pathSymbol;
  30.     char freeSymbol;
  31.     char startSymbol;
  32.     char endSymbol;
  33.  
  34.     bool detectCollision(Coordinate coordinates_);
  35.     Node* findNodeOnList(NodeSet& nodes_, Coordinate coordinates_);
  36.     void releaseNodes(NodeSet& nodes_);
  37.  
  38. public:
  39.     AStar();
  40.     void setMapSize(Coordinate worldSize_);
  41.     void setDiagonalMovement(bool enable_);
  42.     void setHeuristic(HeuristicFunction heuristic_);
  43.     CoordinateList findPath(Coordinate source_, Coordinate target_);
  44.     CoordinateList findPathMPI(Coordinate source_, Coordinate target_, AStarMPICommunication communication, int rank);
  45.     void addCollision(Coordinate coordinates_);
  46.     void removeCollision(Coordinate coordinates_);
  47.     void clearCollisions();
  48.  
  49.     void showMap();
  50.     void updateMap();
  51.     void updateMap(CoordinateList path);
  52. };
  53.  
  54. #endif // __ASTAR_H__
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement