How leilibrk/pacman-ai-project works
Main components
• Game Engine & UI: This includes files such as pacman.py, game.py, graphicsDisplay.py, textDisplay.py, and graphicsUtils.py. This component handles the game loop, rendering, input from the user (keyboardAgents.py), and overall game state.
• Layout Management: With a dedicated “layouts” directory (and files like layout.py), this component manages maze configurations and level representations.
• AI Algorithms & Agents: Several modules implement the algorithms (search.py, searchAgents.py, pacmanAgents.py, ghostAgents.py) that control Pac-Man’s decision-making. Illustrate both uninformed (DFS, BFS, UCS) and informed (A*, Expectimax, Minimax) as separate algorithmic sub-components.
• Testing & Grading Framework: There are numerous test cases in the test_cases directory and grading utilities (autograder.py, grading.py, testParser.py, testClasses.py). This reflects an integration/test harness module.
• Utility Modules: Extra helper modules such as util.py and projectParams.py should also be represented, as they provide cross-cutting functionality.
Relationships and interactions
• How the Game Engine sends the current game state (including maze layout, score, ghost positions, etc.) to the AI Algorithms.
• That each algorithm (DFS, BFS, UCS, A*, Minimax with Alpha-Beta, Expectimax, and Q-learning in the later phase) outputs an action which feeds back into the game engine, affecting Pac-Man’s movement.
• That the testing framework automatically runs a suite of tests on these algorithms, ensuring results and performance metrics.
Architectural patterns and design principles
• Layer Separation: Separate the presentation/UI layer (graphics and keyboard agents) from the game logic and AI decision-making layer.
• Modular Design: Emphasize that each algorithm is implemented in its own module (such as searchAgents.py) so that they can be “swapped” or compared (this is also clear from the test cases that compare algorithm performance).
• Data Flow and Reaction: Since you mentioned “show what the algorithm react with,” add explicit reaction pathways – for example, illustrate that when the game state changes (e.g., a ghost moves), this state is passed to one or more AI algorithm modules, which then compute a new action that “reacts” to the changed environment.
Technologies and Key Elements
• Python is the main technology, so consider highlighting Python’s standard library usage (e.g., __pycache__ and common modules for testing and configuration).