Skip to content

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

🕵️ Wumpus World Knowledge-Based Agent (AI Project)

🌐 Live Deployment

🚀 https://wumpus-world-sooty.vercel.app/


📌 Project Description

The Wumpus World Knowledge-Based Agent is an Artificial Intelligence simulation that demonstrates how an intelligent agent can reason about its environment using logical inference and percept-based decision making.

The project is inspired by the classic AI problem known as the Wumpus World, where an agent must navigate a grid containing hidden dangers (pits and a Wumpus) while trying to make safe decisions using limited percepts.

This implementation is built using PyScript (Python in the browser) combined with HTML5 Canvas, CSS, and JavaScript, allowing full execution directly in the web browser without any backend.


🧠 Core AI Concepts Used

1. Knowledge-Based Agent

The agent maintains a simple knowledge model of the environment and updates its beliefs based on percepts.

2. Percept Handling

The agent receives environmental signals such as:

  • Breeze → indicates nearby pit
  • Stench → indicates nearby Wumpus

3. Logical Reasoning

The agent uses basic rule-based reasoning to decide safe movement cells.

4. Environment Modeling

A grid-based world is created where each cell can contain:

  • Agent position
  • Empty space
  • (Optional extension) hazards like pits or Wumpus

5. Agent Loop

The system follows a continuous loop:

Perceive → Reason → Act → Update State


🚀 Features

🎮 Interactive Simulation

  • Grid-based Wumpus World environment
  • Real-time agent movement visualization
  • Start and step-by-step execution control

🧠 Intelligent Agent Behavior

  • Basic decision-making based on environment state
  • Movement tracking and state updates
  • Simple rule-based reasoning system

🖥️ Visualization

  • HTML5 Canvas-based grid rendering
  • Color-coded agent movement display:
    • 🔵 Blue → Agent
    • ⚪ Gray → Unvisited cells
    • 🟢 Green → Safe/visited path (optional extension)

🌐 Web-Based Execution

  • Runs directly in browser
  • No backend or installation required
  • Powered by PyScript

🛠️ Technologies Used

Technology Purpose
Python (PyScript) Core AI logic
HTML5 UI structure
CSS3 Styling and layout
JavaScript DOM interaction + canvas rendering
Git/GitHub Version control
Vercel Deployment platform

📁 Project Structure


index.html   → User interface (buttons, canvas, layout)
style.css    → Styling and UI design
logic.py     → AI agent logic and environment simulation


⚙️ How the System Works

Step 1: Initialization

  • Grid environment is created
  • Agent starts at position (0,0)

Step 2: Perception

  • Agent detects environmental signals (if implemented)
  • Updates internal knowledge state

Step 3: Decision Making

  • Evaluates possible moves
  • Chooses next safe action

Step 4: Action Execution

  • Agent moves on grid
  • State updates in real-time

Step 5: Visualization

  • Canvas updates after every step
  • Agent position is rendered dynamically

▶️ How to Run Locally

Option 1: Direct Browser

Simply open:


index.html

Option 2: Recommended

  1. Clone repository:
git clone https://github.com/Maheen-Fatima-1/wumpus-world-project.git
  1. Open project folder
  2. Run index.html in a browser

⚠️ Internet connection required (PyScript CDN dependency)


🌍 Deployment

This project is deployed using Vercel, which hosts static web applications.

Live URL:

👉 Click here


📊 Development Process

This project was built using iterative development with Git version control, ensuring each feature is developed and committed separately.

Commit History Structure:

  1. Initial HTML structure (UI setup)
  2. CSS styling and layout improvements
  3. Basic environment logic implementation
  4. Agent movement and state tracking
  5. Final rendering and system integration

This demonstrates proper software engineering workflow rather than single-step development.


🔮 Future Enhancements

  • Full Knowledge Base implementation using propositional logic
  • Advanced inference engine (resolution theorem proving)
  • Pathfinding algorithms (BFS / DFS / A*)
  • Win/Loss conditions (Gold collection, death states)
  • Smarter AI decision-making
  • Sound effects and animations
  • Improved UI with modern game design

👩‍💻 Author

Maheen Fatima Computer Science Student Pakistan 🇵🇰


🏁 Conclusion

This project demonstrates how a simple AI agent can simulate reasoning in an uncertain environment using structured logic, perception handling, and decision-making — all executed in a browser environment using PyScript.

About

A Knowledge-Based AI agent that solves the Wumpus World environment using logical reasoning and inference. Built with Python (PyScript), HTML, and JavaScript, the project demonstrates propositional logic, resolution theorem proving, and safe-path decision making with real-time grid visualization in the browser.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages