A course project for ASU CSE571.
- BFS, DFS, A*, Bi-directional Search(MM and MM0) for pacman and Rubik's Cube.
- We reused pacman code from CSE571 course project1.
- Implemented 2-d Rubik's cube game interface.
- Python2 (Only python2)
- Search algorithms for pacman located in
/pacman/search.py. - Problem class and heuristic function for pacman located in
/pacman/searchAgents.py. - Search algorithms and heuristic function for Rubik's cube located in
/cube/solver.py. - Layouts of pacman located in
\pacman\layouts. - Layouts of Rubik's cube located in
\cube\test. - Main entrances:
\pacman\pacman.pyand\cube\rubikCube.py. - Auto tester for Rubik's cube,
\cube\test.py(Python 3 required for running that tester).
We modified code from course project1, therefore, only one kind of problem (PositionSearchProblem) and one kind of heuristic function (foodHeuristic) can be supported. We only support 4 types of maze: tiny, small, medium and big. Examples:
- To run
bfstest with medium size maze:python2 pacman.py -l mediumMaze -p SearchAgent -a fn=bfs,prob=PositionSearchProblem. - To run
dfstest with tiny size maze:python2 pacman.py -l tinyMaze -p SearchAgent -a fn=dfs,prob=PositionSearchProblem. - To run
astartest with medium size maze:python2 pacman.py -l mediumMaze -p SearchAgent -a fn=astar,prob=PositionSearchProblem,heuristic=foodHeuristic. - To run
bi-directional MM0test with medium size maze:python2 pacman.py -l mediumMaze -p SearchAgent -a fn=bd0,prob=PositionSearchProblem. - To run
bi-directional MMtest with big size maze:python2 pacman.py -l bigMaze -p SearchAgent -a fn=bd,prob=PositionSearchProblem,heuristic=foodHeuristic.
We have two modes for testing: single and multi. In single mode, script will load a single test data contained layout file from /pacman/test, then run the solver and show user game interface. In multi mode, script will load a multiple test data contained layout file from /pacman/test, then run the solver and will not show user the game interface. For each test, user can choose one algorithm from: bfs, dfs, astar, bd and bd0. Examples:
- To run single (with game interface)
bfstest with layout filesingle_rand_2_1:python2 rubikCube.py single single_rand_2_1 bfs. - To run multi
astartest with layout filemulti_rand_4:python2 rubikCube.py multi multi_rand_4 astar. - To run multi
bi-directional MM0test with layout filemulti_rand_8:python2 rubikCube.py multi multi_rand_8 bd0.
We provide a script /pacman/generateTestData.py to generate test data for Rubik's cube problem. The script will based on input simulate user's random input to generate layout. All layout will be guaranteed valid. For multi test data, we will generate 100 time single test data and store it in to multi test data file. Examples:
- To generate a single test data simulating 1 random operation by user named
single_rand_1:python2 generateTestData.py single 1 single_rand_1. - To generate a multiple test data simulating 12 random operation by user named
multi_rand_10:python2 generateTestData.py multi 10 multi_rand_10.
- Yuan Cao (@caoyuan0816)
- Zelin Bao (@baozelin)
- Yiru Hu (@yiruhu)
- Yiting Lin (@Yiting027)