Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Final-Term Assignment
Course Code: SWE 424
Course Title: Artificial Intelligence with Lab
Course Teacher: K. M. Imtiaz-Ud-Din
Assistant Professor
Department of Software Engineering
Date: 24.08.2020
Submitted by:
Name: Abdullah-Al-Yeamin Maruf
ID: 173-35-256
Section: A
Department of Software Engineering
Daffodil International University
1|P a ge
SWE 424 | Artificial Intelligence with Lab
Final-Term Assignment:
Problem:
Problem Description:
A student lives in Younus khan scholar Garden. Which is DIU boys hostel. He want to go DIU
Auditorium for attend concert. There are many possible way to go Boys hostel to DIU
Auditorium.
So now build a simple reflex agent to solve this problem. The agent start from node A, which
is Boys hostel and It’s end node is M, which is DIU Auditorium.
2|P a ge
SWE 424 | Artificial Intelligence with Lab
3|P a ge
SWE 424 | Artificial Intelligence with Lab
Solution:
a. Task Environment:
Hare we see the Daffodil International University Permanent Campus map. Hare every place
has a name. Such as Boys hostel is A, Hall main gate is B, DDBL ATM booth is C, Main gate is
D, DIU golf ground is E, Green garden is F, AB1 is J, food court is N, Admission office is G, AB4
is L, DIU auditorium is M. Here we also see DIU playground, AB3, Bonomaya, Girls hostel.
b. Purpose / Objective:
Now build a goal based agent, which can go from A node which is DIU boys hostel to M
node which is DIU Auditorium.
d. Percepts:
Location: A node, B node, C node, D node, E node, F node, G node, H node, I node, J node, K
node, L node, M node, N node, O node, P node
e. Sensors:
Location Sensor
f. Actions:
moveForword, moveLeft, moveRight
g. Actuators:
wheel, motor, shaft
4|P a ge
SWE 424 | Artificial Intelligence with Lab
List:
1. [A] – move forward / move left / move right
2. [B] – move forward / move left / move right
3. [C] – move forward / move left / move right
4. [D] – move forward / move left / move right
5. [E] – move forward / move left / move right
6. [F] – move forward / move left / move right
7. [G] – move forward / move left / move right
8. [H] – move forward / move left / move right
9. [I] – move forward / move left / move right
10. [J] – move forward / move left / move right
11. [K] – move forward / move left / move right
12. [L] – move forward / move left / move right
13. [M] – move forward / move left / move right
14. [N] – move forward / move left / move right
15. [O] – move forward / move left / move right
16. [P] – move forward / move left / move right
i. Performance Measure:
For every environment state, the agent will itself choose the action that is most likely to
take the agent to its goal. For this problem in every location of the map, the agent itself
will perform the action that is most likely going to take it to its goal or location "M".
5|P a ge
SWE 424 | Artificial Intelligence with Lab
Start State - A
Goal State - M
6|P a ge
SWE 424 | Artificial Intelligence with Lab
edge(a,b).
edge(b,c).
edge(c,f).
edge(f,j).
edge(j,k).
edge(k,m).
edge(j,n).
edge(n,o).
edge(n,p).
edge(c,d).
edge(d,g).
edge(g,f).
edge(g,h).
edge(h,l).
edge(l,k).
edge(k,j).
edge(d,e).
edge(e,h).
edge(h,m).
path(X,Y):-edge(X,Y).
path(X,Y):-edge(X,Z),path(Z,Y),write(Z).
7|P a ge
SWE 424 | Artificial Intelligence with Lab
l. Step by Step process of how Prolog finds out the path from the start state
to the goal state :
How Prolog finds the path from the start to the goal state part 1
k,m(T)(6) k,m(T)(6)
j,m(F)(5) j,m(F)(5)
f,m(F)(4) f,m(F)(4)
c,m(F)(3) c,m(F)(3)
b,m(F)(2) b,m(F)(2)
a,m(F)(1) a,m(F)(1)
path(X,Y):- edge(X,Y).
How Prolog finds the path from the start to the goal state part 2
Output:
?path(a,m).
kjfcb
8|P a ge
SWE 424 | Artificial Intelligence with Lab
m. Output Screenshot:
9|P a ge