Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

COMPUTER ARCHITECTURE AND AI

ASSIGNMENT 2

PEAS AND INTELLIGENT AGENTS FOR


5 FLOOR ELEVATOR

Submitted to:
Dr. Muhammad Ali Ismail

Zuhair Mahmud ME-038

6th April 2018

1|Page
Contents
Agent (5 level lift) .......................................................................................................................................... 3
1. What are Percepts: ........................................................................................................................... 3
2. What are Actions: ............................................................................................................................. 3
3. Example ............................................................................................................................................. 3
4. Precept Sequence ............................................................................................................................. 4
5. PEAS .................................................................................................................................................. 5

2|Page
Agent Design For 5 Floor Elevator

Environment for this agent will be “Reflex agent with state”

1. What are Percepts:


Sensor/encoder (Present Location)

sensor/encoder (Door open/close)

keypad input (KI)

2. What are Actions:


Elevator Motor Actions:

up1, up2, up3, up4

Down1, down2, down3, down4

Stop

Door Motor Actions:

door open

door close

3. Example
To Go to 1st Floor

If Keypad input = 1 then

Check Door open or close

If door = open then

Door close

endif

Check Present Location

If Present Location = 0 then

motor moves up1

3|Page
stop

door open

end if

If Present Location = 3 then

motor moves down2

stop

door open

end if

end

4. Precept Sequence

Percept Sequence Actions


If [ door = close, Present = 0, KI0] stop, door open
If [ door = close, Present = 0, KI1] Moves up1, stop, door open
If [ door = close, Present = 0, KI2] Moves up2, stop, door open
If [ door = close, Present = 0, KI3] Moves up3, stop, door open
If [ door = close, Present = 0, KI4] Moves up4, stop, door open
If [ door = close, Present = 1, KI0] Moves down1, stop, door open
If [ door = close, Present = 1, KI1] stop, door open
If [ door = close, Present = 1, KI2] Moves up1, stop, door open
If [ door = close, Present = 1, KI3] Moves up2, stop, door open
If [ door = close, Present = 1, KI4] Moves up3, stop, door open
If [ door = close, Present = 2, KI0] Moves down2, stop, door open
If [ door = close, Present = 2, KI1] Moves down1, stop, door open
If [ door = close, Present = 2, KI2] stop, door open
If [ door = close, Present = 2, KI3] Moves up1, stop, door open
If [ door = close, Present = 2, KI4] Moves up2, stop, door open
If [ door = close, Present = 3, KI0] Moves down3, stop, door open
If [ door = close, Present = 3, KI1] Moves down2, stop, door open
If [ door = close, Present = 3, KI2] Moves down1, stop, door open
If [ door = close, Present = 3, KI3] stop, door open
If [ door = close, Present = 3, KI4] Moves up1, stop, door open
If [ door = close, Present = 4, KI0] Moves down4, stop, door open
If [ door = close, Present = 4, KI1] Moves down3, stop, door open
If [ door = close, Present = 4, KI2] Moves down2, stop, door open
If [ door = close, Present = 4, KI3] Moves down1, stop, door open
If [ door = close, Present = 4, KI4] stop, door open

4|Page
5. PEAS
Performance = safety, accuracy, repeatability, smooth movement

Environment = Building, Office, Malls, Hospitals

Actuator s= Elevator motor, brakes, Door Motor

Sensors = Floor sensor, elevator motor encoder feedback, keypad input, door sensor, door motor
encoder feedback

5|Page

You might also like