0% found this document useful (0 votes)
27 views14 pages

Unit-4 Module - 2

Uploaded by

tejasborseee
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views14 pages

Unit-4 Module - 2

Uploaded by

tejasborseee
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

Real-Time Decisions and Classical AI

1. Introduction to Real-Time Decisions


Real-time decision-making refers to the ability of a system to make decisions in response to
external stimuli within a time frame that meets the requirements of the task. These decisions are
crucial in environments where delays can lead to suboptimal outcomes or system failures.

Examples of Real-Time Decision Systems


• Autonomous vehicles deciding on lane changes.
• Industrial robots reacting to assembly line changes.
• Stock trading systems executing buy/sell decisions based on market trends.
• Emergency response systems managing disaster relief operations.

2. Classical AI and its Role in Real-Time Decisions


Classical AI focuses on rule-based and logic-driven approaches to solving problems. In real-time
systems, Classical AI applies deterministic algorithms that ensure predictable and reliable behavior
under strict time constraints.

Key Characteristics of Classical AI


1. Symbolic Reasoning:
o Represents knowledge using symbols and applies logical inference to derive
conclusions.
o Example: Rule-based expert systems.
2. Search Algorithms:
o Systematically explores the problem space to find optimal solutions.
o Examples:
▪ Depth-First Search (DFS) for structured decision-making.
▪ A Search* for shortest-path problems.
3. Optimization:
o Employs techniques like linear programming to optimize decisions under
constraints.
4. Knowledge Representation:
o Uses techniques like semantic networks and decision trees to structure data for
logical reasoning.

3. Components of Real-Time Decision Systems


1. Sensors:
o Collect real-world data in real time (e.g., cameras, GPS, IoT devices).
2. Perception:
o Processes sensor data to understand the environment.
o Example: Image recognition in autonomous vehicles.
3. Decision-Making Module:
o Uses Classical AI techniques to determine the optimal course of action.
o Example: Rule-based systems for industrial automation.
4. Actuators:
o Execute decisions in the physical world (e.g., robotic arms, vehicle controls).

4. Classical AI Techniques for Real-Time Decisions


A. Rule-Based Systems
1. Definition:
o Encodes decision rules as “if-then” statements.
o Example:
▪ If temperature>100∘C\text{temperature} > 100^\circ
Ctemperature>100∘C, then activate the cooling system.
2. Strengths:
o Simple to implement.
o Deterministic and reliable.
3. Weaknesses:
o Limited adaptability.
o Requires exhaustive rule specification.

B. Search Algorithms
1. Breadth-First Search (BFS):
o Explores all possible decisions level by level.
o Use Case: Finding shortest paths in graphs.
2. A Search*:
o Combines heuristic estimation with search for optimal solutions.
o Use Case: Pathfinding in robotics.

C. State Machines
1. Definition:
o Models decision-making as transitions between states based on input.
o Example:
▪ Traffic light control systems: Red → Green → Yellow.

D. Decision Trees
1. Definition:
o A tree-like structure where each node represents a decision point.
o Example:
▪ In medical diagnosis, symptoms lead to potential treatments.
2. Real-Time Example:
o Autonomous drones using decision trees for obstacle avoidance.

5. Challenges in Real-Time Decision-Making Using Classical AI


1. Time Constraints:
o Classical AI algorithms may require optimization to meet real-time deadlines.
o Example: Pruning search spaces in A* Search.
2. Scalability:
o Rule-based systems become unmanageable with large datasets or numerous
variables.
3. Uncertainty:
o Classical AI struggles with incomplete or noisy data.
4. Integration:
o Combining decision-making with real-world sensors and actuators introduces
complexity.

6. Advantages of Classical AI in Real-Time Decisions


1. Predictability:
o Deterministic algorithms ensure reliable outcomes.
2. Simplicity:
o Well-defined rules and logic make systems easier to design and debug.
3. Efficiency:
o Optimized algorithms can handle many real-time tasks effectively.

7. Applications of Real-Time Decisions in Classical AI


1. Industrial Automation:
o Monitoring and controlling production lines.
2. Healthcare:
o Real-time patient monitoring and automated diagnosis.
3. Transportation:
o Traffic management and autonomous vehicle navigation.
4. Gaming:
o AI opponents making moves in real-time.

8. Real-Time Decision Example: Traffic Light Control


1. Objective:
o Minimize waiting time and ensure smooth traffic flow.
2. Inputs:
o Vehicle counts at intersections.
3. Decision Rules:
o If vehicle count on the main road > side road, prioritize main road.
4. Actuators:
o Control signal lights.
Checkers, Chess, Othello, Go, and Backgammon

1. Introduction to Board Games


Board games are strategic or luck-based games played on predefined grids or boards. In artificial
intelligence (AI), these games are often used as benchmarks for developing and testing algorithms
that involve planning, problem-solving, and decision-making.

2. Checkers (Draughts)
Overview:
• Origin: Dates back to ancient Egypt (around 3000 BCE).
• Board: Played on an 8x8 board with alternating dark and light squares.
• Players: Two.
• Objective: Capture all opponent’s pieces or block them from making legal moves.
Rules:
1. Movement:
o Pieces move diagonally forward one square to an empty space.
2. Capturing:
o A piece can capture an opponent’s piece by jumping over it into an empty square
beyond.
3. Kinging:
o When a piece reaches the opponent's back row, it becomes a "king" and can move
diagonally both forward and backward.
4. Winning:
o Achieved by capturing all opponent’s pieces or blocking them.
AI and Checkers:
• Checkers was solved by AI (e.g., Chinook), proving a perfect strategy exists.
• Techniques Used:
o Minimax algorithm.
o Alpha-beta pruning.
o Endgame databases.

3. Chess
Overview:
• Origin: India, around the 6th century (as Chaturanga).
• Board: 8x8 grid.
• Players: Two.
• Objective: Checkmate the opponent’s king.
Rules:
1. Piece Movement:
o Pawn: Moves forward; captures diagonally.
o Rook: Moves horizontally or vertically.
o Knight: Moves in an L-shape.
o Bishop: Moves diagonally.
o Queen: Moves any number of squares in any direction.
o King: Moves one square in any direction.
2. Special Moves:
o Castling, En Passant, Pawn Promotion.
3. Checkmate:
o The game ends when the king cannot escape capture.
AI and Chess:
• Chess has been a key area of AI research.
• IBM’s Deep Blue defeated world champion Garry Kasparov in 1997.
• Techniques Used:
o Minimax algorithm.
o Heuristics for board evaluation.
o Endgame tablebases.

4. Othello (Reversi)
Overview:
• Origin: Late 19th century (Reversi); modern Othello in 1971.
• Board: 8x8 grid.
• Players: Two.
• Objective: Have the majority of pieces of your color on the board at the end.
Rules:
1. Game Start:
o Four discs (two black, two white) are placed in the center in a diagonal pattern.
2. Placing Pieces:
o Players take turns placing their discs to sandwich opponent's discs between their
own.
o Sandwiched discs are flipped to the current player’s color.
3. Legal Moves:
o Must capture at least one of the opponent’s discs.
4. Winning:
o The player with the most discs of their color at the end wins.
AI and Othello:
• Strategies involve maximizing mobility and controlling corners.
• AI programs like Edax demonstrate strategic dominance.
• Techniques Used:
o Heuristic evaluation.
o Minimax search with alpha-beta pruning.

5. Go
Overview:
• Origin: China, over 2500 years ago.
• Board: 19x19 grid (smaller boards like 9x9 and 13x13 are also used).
• Players: Two.
• Objective: Surround more territory than the opponent.
Rules:
1. Placing Stones:
o Players alternately place stones on intersections of the board.
2. Capturing:
o Stones are captured when surrounded with no empty "liberties."
3. Scoring:
o Points are awarded for surrounded territory and captured stones.
4. Winning:
o The player with the highest score wins.
AI and Go:
• Go is exponentially more complex than chess due to the larger board and open-ended
strategies.
• Breakthrough: AlphaGo by DeepMind defeated world champion Lee Sedol in 2016.
• Techniques Used:
o Deep reinforcement learning.
o Monte Carlo tree search.

6. Backgammon
Overview:
• Origin: Ancient Mesopotamia, around 3000 BCE.
• Board: 24 triangular points divided into four quadrants.
• Players: Two.
• Objective: Move all checkers to your home board and bear them off before your opponent.
Rules:
1. Dice Rolls:
o Determine the number of moves.
2. Checker Movement:
o Move checkers based on dice rolls, adhering to rules about open points and blocks.
3. Hitting:
o Land on an opponent’s blot to send it to the bar.
4. Winning:
o By bearing off all your checkers first.
AI and Backgammon:
• Backgammon combines strategy and luck.
• TD-Gammon, developed by IBM, was a breakthrough AI program using reinforcement
learning.

Comparison Table

Game Complexity AI Techniques Key Features

Checkers Moderate Minimax, Alpha-Beta Pruning Endgame solvability.

Chess High Minimax, Heuristics, Tablebases High combinatorial depth.

Othello Moderate Heuristic Evaluation, Alpha-Beta Emphasis on board control.

Deep Learning, Monte Carlo Tree Exponentially large state


Go Very High
Search space.

Mix of strategy and


Backgammon Moderate Reinforcement Learning
randomness.

These games serve as benchmarks for testing AI's strategic reasoning. While classical methods
excel in structured games like chess and checkers, modern AI techniques like deep learning and
reinforcement learning have expanded capabilities to complex domains like Go and Backgammon.
Application of AI in Video Games

1. Introduction to AI in Video Games


Artificial Intelligence (AI) in video games refers to the creation of intelligent behaviors in non-
player characters (NPCs) or game environments. It enhances the gaming experience by creating
dynamic, responsive, and challenging interactions. AI in video games is distinct from general AI
as it focuses on entertainment and realism rather than achieving human-like intelligence.

2. Key Objectives of AI in Video Games


1. Enhancing Player Experience:
o Provides challenging and adaptive gameplay.
o Examples: Smarter enemies, realistic allies.
2. Realistic Environments:
o Simulates lifelike worlds with interactive NPCs.
3. Dynamic Content Generation:
o Procedurally generates levels, quests, or events.
4. Game Testing and Balancing:
o AI agents test game mechanics for bugs and difficulty calibration.

3. Types of AI in Video Games


1. Deterministic AI:
o Predictable behavior based on predefined rules.
o Example: NPCs following fixed patrol routes in stealth games.
2. Non-Deterministic AI:
o Introduces randomness or adaptability for unpredictability.
o Example: Enemies learning player strategies.

4. Core AI Techniques Used in Video Games


A. Finite State Machines (FSMs)
• Defines NPC behavior as states with transitions.
• Example: Guards in stealth games switching between “Patrolling,” “Chasing,” and
“Searching.”
B. Pathfinding Algorithms
• Determines optimal paths for NPC movement.
• Techniques:
o A Algorithm*: Balances cost and efficiency.
o Navigation Meshes (NavMesh): Divides game maps into walkable areas.
• Example: NPCs navigating complex terrains in The Legend of Zelda: Breath of the Wild.
C. Decision Trees
• Uses a tree-like structure to decide NPC actions.
• Example: Combat decision-making in FIFA.
D. Machine Learning
• Enables NPCs to learn and adapt over time.
• Techniques:
o Reinforcement Learning: NPCs improve performance through trial and error.
o Neural Networks: Models complex behaviors and environments.
• Example: AI opponents adapting strategies in StarCraft II.
E. Procedural Content Generation (PCG)
• Automates the creation of game assets like levels, maps, and characters.
• Example: Infinite worlds in Minecraft.

5. Applications of AI in Video Games


A. Intelligent NPCs
1. Definition:
o NPCs behave realistically in response to player actions.
2. Examples:
o Companions in The Last of Us assisting in combat.
o Enemies in Halo coordinating attacks.
B. Adaptive Difficulty
1. Definition:
o AI adjusts game difficulty based on player performance.
2. Examples:
o AI opponents in racing games like Mario Kart increasing speed if the player
performs well.
C. Procedural Content Generation
1. Definition:
o AI generates levels, items, or quests dynamically.
2. Examples:
o Random dungeons in Diablo III.
o Terrain generation in No Man’s Sky.
D. Virtual Worlds
1. Definition:
o AI governs NPC interactions and world dynamics.
2. Examples:
o Living cities in Grand Theft Auto V where NPCs have routines.
E. Realistic Animations
1. Definition:
o AI creates fluid and responsive character animations.
2. Examples:
o Motion blending in Assassin’s Creed games.
F. Game Testing
1. Definition:
o AI automates testing to identify bugs or balancing issues.
2. Examples:
o AI bots stress-testing multiplayer servers.

6. Case Studies of AI in Video Games


A. The Sims
• AI Role:
o Simulates lifelike NPC behaviors.
• AI Techniques:
o Behavior trees for decision-making.
o Needs-based systems (e.g., hunger, sleep).
**B. F.E.A.R. (First Encounter Assault Recon)
• AI Role:
o Enemies exhibit coordinated tactics like flanking and using cover.
• AI Techniques:
o Goal-oriented action planning (GOAP).
C. Dota 2 and StarCraft II
• AI Role:
o AI bots like OpenAI’s Five and AlphaStar compete at a professional level.
• AI Techniques:
o Deep reinforcement learning for strategy and teamwork.

7. Challenges of AI in Video Games


1. Balancing Realism and Fun:
o Overly smart AI can frustrate players.
2. Performance Limitations:
o Complex AI algorithms can strain hardware.
3. Unpredictable Player Behavior:
o Players often find ways to exploit AI systems.
4. Development Costs:
o Designing advanced AI requires time and expertise.

8. Future of AI in Video Games


1. Advanced Machine Learning:
o AI companions capable of emotional interactions.
2. Dynamic Storytelling:
o AI crafting personalized narratives.
3. Immersive Worlds:
o Fully simulated environments with evolving NPCs.
4. AI-Powered Game Design:
o AI tools assisting developers in creating games.

9. Example Scenario
• Game: Open-world RPG.
• Objective: AI simulates a town with lifelike NPCs.
• AI Features:
o NPCs have schedules (e.g., merchants opening shops, guards patrolling).
o Adaptive quest system where NPCs react to player choices.
• AI Techniques:
o FSM for NPC routines.
o Decision trees for quest outcomes.

You might also like