AI Player Logic Module
This module defines the logic and strategies for Artificial Intelligence (AI) players within the Property Tycoon game. It provides different AI personalities or difficulty levels, encapsulating the decision-making processes for various game situations like buying properties, bidding in auctions, managing assets, and handling jail time.
The AI Player Logic module provides:
EasyAIPlayer: A baseline AI implementing straightforward decision rules based on predefined strategy parameters (e.g., bid multipliers, development thresholds).
HardAIPlayer: A more complex AI that builds upon the Easy AI logic but introduces a ‘mood’ or ‘emotion’ system. This mood modifier influences decisions, making the AI more aggressive or conservative depending on hunman player’s selection.
Methods for evaluating property value from the AI’s perspective.
Logic for deciding whether to buy properties, bid in auctions, develop properties, mortgage/unmortgage assets, and handle jail situations.
Helper functions for analyzing property groups and ownership.
- class src.Ai_Player_Logic.EasyAIPlayer(difficulty='easy')[source]
Bases:
object
High-Level Design
Use Case Diagram (AI Decision Making)
Illustrates the primary decision points where the Game Logic interacts with the AI Player Logic module.
Shows the core concepts involved in the AI’s decision-making process.
Detailed Design
AI Player Class Diagram
Details the structure of EasyAIPlayer and HardAIPlayer, their methods, and relationship.
Activity Diagram: Hard AI Auction Bid Decision
Illustrates the flow for HardAIPlayer.get_auction_bid, showing the interaction with EasyAIPlayer and the mood influence.
Sequence Diagram: Hard AI Purchase Decision (should_buy_property)
Shows HardAIPlayer deciding whether to buy, potentially overriding the EasyAIPlayer logic based on mood.
Sequence Diagram: Updating AI Mood (update_mood)
Shows the simple process of adjusting the mood_modifier.