Maze Solver_RWA2_GROUP21
This project is used to solve the maze using wall follower algorithm
|
Go to the documentation of this file.
11 #ifndef __ALGORITHM_H__
12 #define __ALGORITHM_H__
17 #include "../robot/robot.h"
19 namespace rwa2group21 {
30 void run(std::string algo);
84 Algorithm() : robot (std::make_unique<
Robot>()), m_maze_height{16} , m_maze_width{16},goal{0,0}{
87 std::unique_ptr<Robot> robot;
88 std::pair<int, int> goal;
void traceback_robot_movement()
Function for tracing back robot movement using coordinates generated from coordinate elimination func...
Definition: algorithm.cpp:289
This file contains the implementation details for algorithm class.
static void setText(int x, int y, const std::string &text)
Set the text in a cell at the given coordinates.
Definition: simulator.cpp:88
void set_right_wall()
Setting the right wall of a cell whenever the bot in that particular cell finds a wall on the right w...
Definition: algorithm.cpp:223
void follow_wall_right()
right handed wall algorithm is executed using methods of robot class by recording and evaluating curr...
Definition: algorithm.cpp:112
static void setWall(int x, int y, char direction)
Set a wall at the given coordinates.
Definition: simulator.cpp:68
void init_outer_walls()
This method is internally called from the run method to highlight all the outer walls of any maze sel...
Definition: algorithm.cpp:184
void set_front_wall()
Setting the front wall of a cell whenever the bot in that particular cell finds a wall on the front w...
Definition: algorithm.cpp:206
static bool wallFront()
Check if there is a wall in front of the robot.
Definition: simulator.cpp:19
void run(std::string algo)
This method is called from the main file, after which the whole methods of bot traversing around maze...
Definition: algorithm.cpp:238
void traceback_coordinate_elimination()
Function is responsible for elimination of deadend coordinates during forward movement of the robot.
Definition: algorithm.cpp:259
static void clearAllColor()
Clear the color of all cells in the maze.
Definition: simulator.cpp:84
void generate_goal()
generating a random goal every time using srand and rand function and is done during the start of the...
Definition: algorithm.cpp:10
void set_left_wall()
Setting the left wall of a cell whenever the bot in that particular cell finds a wall on the left whe...
Definition: algorithm.cpp:209
Algorithm()
Creating a constructor using member initalisation list and default values. Intialised the instance of...
Definition: algorithm.h:84
static void clearAllText()
Clear the text in all cells of the maze.
Definition: simulator.cpp:96
This class implements the search algorithm using a Left hand approach or right hand approach.
Definition: algorithm.h:23
void follow_wall_left()
left handed wall algorithm is executed using methods of robot class by recording and evaluating curre...
Definition: algorithm.cpp:39
static bool wallRight()
Check if there is a wall to the right of the robot.
Definition: simulator.cpp:26
static bool wallLeft()
Check if there is a wall to the left of the robot.
Definition: simulator.cpp:33
static void setColor(int x, int y, char color)
Set the color of the cell at the given coordinates.
Definition: simulator.cpp:76