๐Ÿค– Vacuum World Agent Simulator

PECST522 โ€” Artificial Intelligence

๐ŸŽฎ Mode 1: Manual Control โ€” "Be the Agent"

๐Ÿ“– How to Play

Objective: You ARE the vacuum agent. Clean both rooms to maximize your score.

Rules: Use Left/Right to move between rooms, Suck to clean a dirty room. Each action costs 1 point, but you earn +1 for each clean room every step. Click a room to toggle its dirt status. NoOp skips your turn.

AI Concept: This is the agent-environment interaction loop. You experience what a Simple Reflex Agent must decide every step โ€” observe the percept (location + dirt status), then choose an action.

You are the vacuum agent. Click rooms to toggle dirt, then use buttons to act. Score: +1 per clean square per step, โˆ’1 per action cost.

๐Ÿค– Room A Dirty
Room B Dirty
Score
0
Steps
0
๐Ÿ“Š How Points Work: Each step โ†’ +1 for every clean room, โˆ’1 for each action (except NoOp). Clean both rooms to maximize!

๐Ÿ“œ Action Log

Actions will appear here...

๐Ÿง  Mode 2: Agent Selector โ€” "Watch Different Agents"

๐Ÿ“– How to Play

Objective: Observe how 4 different agent architectures solve the same cleaning task.

Rules: Select an agent type from the dropdown, then click Step (one action) or Run (continuous). Watch the side panel โ€” it shows each agent's internal reasoning in real-time.

AI Concept: Compares the 4 agent types from AIMA Ch.2: Simple Reflex (conditionโ†’action rules), Model-Based (internal state tracking), Goal-Based (plans toward all-clean), and Random. Notice how Simple Reflex works perfectly here because the environment is fully observable.

Select an agent architecture and watch it solve the Vacuum World autonomously.

๐Ÿค– Room A Dirty
Room B Dirty
Fast Slow 500ms
Score
0
Steps
0

๐Ÿ” Agent Internal State

Select an agent and press Step or Run to begin.
๐Ÿ“Š Score: +1 per clean room per step. Watch how each agent's strategy affects total score.

๐Ÿ“œ Action Log

Agent actions will appear here...

๐Ÿง  Mode 3: Rule Editor โ€” Program Your Agent

๐Ÿ“– How to Play

Objective: Design your own condition-action rule table and see if your agent can clean both rooms optimally.

Rules: For each possible percept (location + dirt status), choose an action from the dropdown. Then click "Run My Agent" to watch it execute for 20 steps. Try to reach 36+ points!

AI Concept: This is AIMA Table 2.3 โ€” the complete agent function as a lookup table. There are only 4 possible percepts in this environment, so the entire agent program fits in 4 rules. Can you figure out the optimal mapping? Hint: think about what the agent should do when there's nothing to clean in its current room.

๐Ÿ† Challenge: Can you find the perfect rule set? Target: 36+ points!
Initial state: Both rooms are dirty. You have 20 steps. Design one action for each possible percept.
๐Ÿ“Š Scoring Rules:
  • +1 point for each clean room at the end of every step (max +2/step)
  • +10 bonus if both rooms are clean when the 20 steps finish
  • Maximum possible: 20 steps ร— 2 rooms + 10 bonus = 50 points
  • Target to beat: 36+ points (excellent), 40 = perfect

Your Rule Table

Location Status โ†’ Action
A Clean
A Dirty
B Clean
B Dirty
Score: โ€” / 40
A
B
Configure your rules above, then press Run My Agent...

๐Ÿ”ฌ Mode 4: Environment Properties Lab

๐Ÿ“– How to Play

Objective: See how changing environment properties breaks simple agents and demands more sophisticated architectures.

Rules: Toggle the environment switches (Partially Observable, Stochastic, Dynamic, Larger World), select an agent type, then click "Run Experiment" to observe behavior over 30 steps.

AI Concept: The 6 environment dimensions from AIMA Ch.2 determine agent design complexity. Partially Observable โ†’ Simple Reflex fails (can't see other room); Stochastic โ†’ plans may fail; Dynamic โ†’ must re-plan continuously. This is why we need Model-Based and Goal-Based agents.

Explore how environment properties affect agent performance. Toggle properties, select an agent, and run experiments!

Environment Properties

Agent

Score: โ€”
A
B
Toggle properties, select an agent, and press Run Experiment...

๐Ÿ“– How Properties Affect Agents

๐Ÿ‘ Partial Observability

When the agent can't see the other room, Simple Reflex fails! It has no memory โ€” it doesn't know if the other room is still dirty. A Model-Based agent maintains an internal model of the world and can track what it hasn't observed.

๐ŸŽฒ Stochasticity

Actions can have unintended outcomes. A Goal-Based agent's plan may fail mid-execution โ€” it must re-sense and re-plan after each action. Simple reflex agents are somewhat robust since they react to each step independently.

๐ŸŒŠ Dynamic Environment

The world changes while the agent acts. Dirt appears randomly! The agent must re-plan continuously โ€” a one-shot plan is never enough. Model-Based and Goal-Based agents handle this best by maintaining up-to-date world models.

๐Ÿ  Larger World

More rooms = harder exploration problem. The agent must navigate efficiently between rooms. Simple Reflex agents wander randomly; Model-Based agents use their internal map to plan efficient paths.

๐Ÿ—บ๏ธ State Space Diagram

๐Ÿ“– How to Play

Objective: Visualize the complete state space โ€” every possible world state and the transitions between them.

Rules: The diagram shows all 8 states (2 positions ร— 4 dirt combinations). Green arrows = Suck action, Blue arrows = Move (Left/Right). As modes 1-2 run, the current state highlights in gold.

AI Concept: A well-defined problem has 5 components: Initial State, Actions, Transition Model, Goal Test, Path Cost. This diagram IS the transition model. The 8 states = the entire state space of the 2-room vacuum world (AIMA Figure 3.2).

All 8 possible states of the Vacuum World and transitions between them.

8 states = 2 agent positions (A or B) ร— 2ยฒ dirt configurations (each room Clean or Dirty)
Reading the Diagram: Each box is a state: [Agent Position, Room A status, Room B status]. Green arrows = Suck action (cleans current room). Blue arrows = Move (Left/Right). The gold highlighted node = current state during simulation.
Agent A Agent B
Suck (clean room) Move (Left/Right) NoOp (wall / already clean)
Click a node to inspect it, or run Mode 1 / Mode 2 to see the current state highlighted live.

๐Ÿ“Š Performance Comparison

๐Ÿ“– How to Play

Objective: Quantitatively compare all 4 agent types running in identical conditions.

Rules: Click "Compare All Agents" to run each agent for 50 steps from the same starting state (both rooms dirty, agent in A). Results show scores, steps to goal, and whether each agent reached the goal.

AI Concept: Agent performance measurement โ€” the rationality of an agent depends on its performance measure, environment, and actuators (PEAS). Simple Reflex and Goal-Based both achieve the goal, but Goal-Based is more efficient. Random almost never reaches the goal optimally.

Run all 4 agents side-by-side and compare their scores and efficiency.