tachia

Untitled

Jul 3rd, 2018
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.67 KB | None | 0 0
  1. #ifndef Trailblazer_Included
  2. #define Trailblazer_Included
  3.  
  4. #include "TrailblazerTypes.h"
  5. #include "set.h"
  6. #include "grid.h"
  7.  
  8. /* Function: shortestPath
  9.  *
  10.  * Finds the shortest path between the locations given by start and end in the
  11.  * specified world.  The cost of moving from one edge to the next is specified
  12.  * by the given cost function.  The resulting path is then returned as a
  13.  * Vector<Loc> containing the locations to visit in the order in which they
  14.  * would be visited.    If no path is found, this function should report an
  15.  * error.
  16.  *
  17.  * In Part Two of this assignment, you will need to add an additional parameter
  18.  * to this function that represents the heuristic to use while performing the
  19.  * search.  Make sure to update both this function prototype and the
  20.  * implementation inside of Trailblazer.cpp.
  21.  */
  22. Vector<Loc>
  23. shortestPath(Loc start,
  24.              Loc end,
  25.              Grid<double>& world,
  26.              double costFn(Loc from, Loc to, Grid<double>& world));
  27.  
  28. /* Function: createMaze
  29.  *
  30.  * Creates a maze of the specified dimensions using a randomized version of
  31.  * Kruskal's algorithm, then returns a set of all of the edges in the maze.
  32.  *
  33.  * As specified in the assignment handout, the edges you should return here
  34.  * represent the connections between locations in the graph that are passable.
  35.  * Our provided starter code will then use these edges to build up a Grid
  36.  * representation of the maze.
  37.  */
  38. Set<Edge> createMaze(int numRows, int numCols);
  39.     struct Info{
  40.         string color;
  41.         Loc parent;
  42.         int way;
  43.     };
  44.     void makeList ( Map<Loc,Info> &allInf, Grid<double> & world);
  45.     Set<Loc> makeNeighbours(Loc & loc, Grid<double> & world);
  46.  
  47. #endif
Advertisement
Add Comment
Please, Sign In to add comment