How joseangelbmt/othello_intelligent_agents works
Main Components
• User Interface Layer:
• Represented by MainGame.py and Interface.py.
• Game Logic and Rules:
• GameRules.py contains the core rules of Othello.
• Node.py and possibly Prueba.py relate to representing game states or might be used for test/debug purposes.
• Intelligent Agents:
• Agent.py includes classes implementing the different intelligent agents, including those using the Alpha-Beta pruning and MCTS algorithms.
• Evaluation Module:
• Evaluator.py is responsible for evaluating moves. It is specifically tied to the Alpha-Beta agent through the use of a weight matrix.
• Evolutionary Algorithm:
• Genetic.py implements the genetic algorithm for optimizing evaluation weights.
• AGCHC.txt is the output file where the results from the genetic computation (weight matrices, fitness evolution, execution times) are stored.
• Simulation and Data Logging:
• Simulation.py lets you run automated game simulations.
• othello.csv stores the outcomes and studies from these simulations.
• External Dependencies and Setup:
• The requirements.txt file shows the external libraries or dependencies.
• Any IDE/project configuration (e.g., .idea folder) can be noted as supporting infrastructure.
Relationships and Interactions
• The user launches the project through MainGame.py, which invokes the graphical user interface (Interface.py).
• The interface leads to player selection and determines which intelligent agents (from Agent.py) will play.
• During gameplay, game rules (GameRules.py) and state handling (Node.py) are used to progress the game.
• Agents make decisions using their specific strategies:
• The Alpha-Beta agent uses Evaluator.py for evaluating game positions.
• The MCTS agent uses predetermined iterations (modifiable through “selectPlayers” in MainGame.py).
• The genetic algorithm (Genetic.py) may run independently to optimize the weight matrix, outputting results to AGCHC.txt.
• Simulation.py is a specialized module for creating game simulations and logs outcomes to othello.csv.
Architectural Patterns and Design Principles
• Separation of Concerns: Distinct modules for UI, game logic, AI agents, evaluation, evolutionary computation, and simulation.
• Modularity: Each file represents a core component that can be independently modified or replaced.
• Configurability: Parameters like evaluator weights and MCTS iterations can be tuned in the controller logic of MainGame.py and within respective module constructors.
• Data Flow: User interactions flow from the UI into game mechanics and agent decision-making, while evolutionary optimization and simulation log their results to external files.