Beruflich Dokumente
Kultur Dokumente
Report Document
Document for
for CSC463
CSC 463Projects
Projects
REPORT FOR
FUNDAMENTALS OF ARTIFICIAL
INTELLIGENCE PROJECT
(CSC463)
Version 1.0
CONFIDENTIAL
Version
Version 1.0
1.0 (Confidential)
(Confidential) Page
Page 11 of
of 89 PROPOSAL/CWS/1.0/2011
REPORT/1.0/2011
Report Document for CSC463 Projects
Committee Members:
Reviewed By:
_______________________
Pn. Itaza Afiani Mohtar
Lecturer
Universiti Teknologi MARA
Seri Iskandar Campus
32610, Bota
Perak Darul Ridzuan
Date:
Table of Contents
1. Introduction......................................................................................................................4
2. Problem Formulation.......................................................................................................5
2.1 State Space.................................................................................................................5
2.2 Well-Defined Problem...............................................................................................6
Figure 1: Initial State...................................................................................................6
Figure 2: Goal State.....................................................................................................7
3. Search Algorithm.............................................................................................................8
4. Program code...................................................................................................................9
1. Introduction
W e have been given a task to solve problem that has been face by a farmer. A
farmer wants to transport himself along with a fox, a goose, and some grains
across a river. The boat could only take at most one of his possessions any trip. The
constraints of this problem are the fox must not be left unattended with the goose, and the
goose must not be left unattended with the grains.
2. Problem Formulation
2.1 State Space
Farmer, fox,
goose, grains
B A
B A B A
B A B A
B A
B A B A
Fox Farmer, goose,
Goose, grains Farmer, fox grains
B A
B A
Farmer, fox, Fox, goose Farmer, grains
Grains
goose
B A B A
B A
B A
In order to solve the problem, we consider well defined problem. The initial
state of this problem is at place A there is a farmer with a fox, a goose and some grains.
While at place B there is no one.
A
Figure 1: Initial State
The possible actions that the farmer can do are whether bring along with him a
fox first or a goose first or some grains first or brings himself only. But the farmer must
also consider constrains that is do not left behind the fox and the goose together or left
the goose and the grains together.
The transition model is if the farmer chooses to bring a fox first then he will
leave a goose and some grains at place A. The result is a goose will eat the grains. If the
farmer chooses to bring the grains first, then the fox will eat the goose. In order solve
this problem, the farmer only has one choice that is bring the goose first and left the fox
together with the grains. When the farmer return to place A he has to choose either to
bring fox or grains to place B. If he choose to bring fox then, then he must return to
bring the grain, result is the fox will eat goose at place B. While if he chooses to bring
the grains, when he returns, result is the goose will eat the grains at place B. So, the
farmer must decide either to bring fox or grains to place B and then brings back the
goose to place A. The current state is at place A there is a goose and farmer while at
place B there is a fox and some grains. Finally the farmer has to bring the goose to place
B. Now the current state is there is nothing at place A and there is a fox, a goose and
some grains at place B.
The goal of this problem is to transfer the entire farmer possessions that is a fox,
a goose, and some grains to place B.
A
Figure 2: Goal State
The path cost of this problem is the number of crossing that the farmer must
make in order to bring all of his possessions to place B. From above summarized action
there are seven crossing, that is four forward and three backward. So, the path cost of
this problem is 7.
3. Search Algorithm
In order to find the solution for this problem we choose to use algorithm from
heuristic search that is A* algorithm.
4. Program code