/
The  AMazing  Problem Lance The  AMazing  Problem Lance

The AMazing Problem Lance - PowerPoint Presentation

clara
clara . @clara
Follow
66 views
Uploaded On 2023-09-23

The AMazing Problem Lance - PPT Presentation

Danzy Melinda Katanbafnezhad Project Description The A Mazing Problem is a classical experiment from psychology where scientists carefully observe a rat going through a maze This experiment is performed repeatedly until the rat goes through the maze without going down a single dead ID: 1019901

startcol startrow path maze startrow startcol maze path dead method point labelpath return youtube www themaze watch wall mark

Share:

Link:

Embed:

Download Presentation from below link

Download Presentation The PPT/PDF document "The AMazing Problem Lance" is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.


Presentation Transcript

1. The AMazing ProblemLance DanzyMelinda Katanbafnezhad

2. Project Description The “A Mazing Problem” is a classical experiment from psychology where scientists carefully observe a rat going through a maze. This experiment is performed repeatedly until the rat goes through the maze without going down a single dead end path. This demonstrates the rat’s learning curve. The computer program that does the same thing is not any smarter than the rat on its first try through, but the computer can remember the mistakes it made. The second time it runs through the maze it should go all the way through without going down dead ends. With a computer’s memory, and the right algorithm going through a maze is simple.

3. Research DesignUsing a recursive method every time a spot is visited, the method checks all surrounding spots for a path and marks what’s already been visited. If it reads in a point that is not a wall or marked as visited, it moves to that point. It will continuously do this until it has reached a mark indicating the end of the maze. If it reaches a dead end, it does not mark the point.

4. public bool labelPath(int startRow, int startCol)        {                       //from the starting location specified by the parameters to the finis            //is point in the maze boundaries            if (startRow < 0 || startRow >= rows || startCol < 0 || startCol >= cols)            {                return false;            }            if (theMaze[startRow, startCol] == 'F')            {                // we are at the end of the maze                return true;            }            // is point a valid path?            if (theMaze[startRow, startCol] == ' ')            {                // mark this path just in case it works from here                theMaze[startRow, startCol] = '-';                // find if there is a route past here                if (labelPath(startRow + 1, startCol) || labelPath(startRow - 1, startCol) || labelPath(startRow, startCol + 1) || labelPath(startRow, startCol - 1))                {                    // this is a good path!                    return true;                }                else                {                    // this is not a good path - unmark it.                    theMaze[startRow, startCol] = ' ';                }            }            return false;        }

5. Alternative Solutions Wall Follower The best known rule for traversing mazes, also known as the left hand rule or the right hand rule. This method always keeps the wall on one side of the navigator, by doing this the navigator is guaranteed not to get lost and will reach an exit if there is one. http://www.youtube.com/watch?v=6cpQ3c-yd-s

6. Dead-end Filling This method looks at the entire maze once, finds all the dead-ends and then fills in the path from each dead end until there is a continuous path from start to finish.http://www.youtube.com/watch?v=yqZDYcpCGAI

7. Real Life Implementation: GPS Similar to how a GPS finds the shortest route to a destination, our algorithm determines the shortest path to the end of a maze, although a GPS may not necessarily use this algorithm and knows your location. If you ever find yourself trapped inside of a maze/labyrinth we recommend that you use a wall following method to escape, not recursion.

8. Referenceshttp://en.wikipedia.org/wiki/Maze_solving_algorithmHorowitz, E., Sahni, S., & Mehta, D. (1995). Fundamentals of Data Structures in C++. New York: W. H. Freeman & Co.http://www.youtube.com/watch?v=yqZDYcpCGAIhttp://www.youtube.com/watch?v=6cpQ3c-yd-s