Professional Documents
Culture Documents
Mid-Term Assignment: Submitted by
Mid-Term Assignment: Submitted by
Mid-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
Mid-Term Assignment:
Problem:
Problem Description:
A student lives in Younus khan scholar Garden. Which is DIU boys hostel. He want to go AB-4
for attend classes. There are many possible way to go Boys hostel to AB-4.
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 L, which is AB-4.
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 simple reflex agent, which can go from A node which is DIU boys hostel to L
node which is AB-4.
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
Colour: Black, Red
e. Sensors:
Location Sensor, Colour Sensor
f. Actions:
moveForword, moveLeft, moveRight, standby
g. Actuators:
wheel, motor, shaft, no operation mode program
4|P a ge
SWE 424 | Artificial Intelligence with Lab
5|P a ge
SWE 424 | Artificial Intelligence with Lab
i. Performance Measure:
Performance Measure is a scale that will help us to understand which action is the most
desirable action or the best action in a certain situation or environment state.
+1 point for move forward, move left or move right to a different location or standby if
current location is Red
j. Decision Tree:
6|P a ge
SWE 424 | Artificial Intelligence with Lab
j. Decision Tree:
i. Agent Function:
7|P a ge
SWE 424 | Artificial Intelligence with Lab
j. Agent Program:
#include <stdio.h>
#define Black 0
#define Red 1
#define move_forward 2
#define move_left 3
#define move_right 4
#define standby 5
#define A 10
#define B 11
#define C 12
#define D 13
#define G 14
#define H 15
#define L 16
8|P a ge
SWE 424 | Artificial Intelligence with Lab
int main()
{
//taking percepts
int location, colour;
9|P a ge
SWE 424 | Artificial Intelligence with Lab
int robotStatus = 1;
while(robotStatus) {
printf("Please Enter location - A = 10 / B = 11 / C = 12 / D = 13 / G
= 14 / H = 15 / L = 16 \n");
scanf("%d", &location);
printf("Please Enter colour - Black = 0 / Red = 1 \n");
scanf("%d", &colour);
//decision making
//calling the C function that implemented agent function
int action = student_robot_agent(location,colour);
//performing action
if(action == move_forward){
printf("--- Move Forword ---\n\n");
}
10 | P a g e
SWE 424 | Artificial Intelligence with Lab
K. Output Screenshot:
11 | P a g e