Sie sind auf Seite 1von 9

Report

Report Document
Document for
for CSC463
CSC 463Projects
Projects

REPORT FOR
FUNDAMENTALS OF ARTIFICIAL
INTELLIGENCE PROJECT
(CSC463)

Version 1.0

Document Reference No: REPORT/1.0/2011

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:

En. Nazri 2009


En. Ibrahim 2009
Cik Nor Azura Binti Mohamed Salim 2009961145

Reviewed By:

_______________________
Pn. Itaza Afiani Mohtar

Lecturer
Universiti Teknologi MARA
Seri Iskandar Campus
32610, Bota
Perak Darul Ridzuan

Date:

Version 1.0 (Confidential) Page 2 of 9 REPORT/1.0/2011


Report Document for CSC463 Projects

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

Version 1.0 (Confidential) Page 3 of 9 REPORT/1.0/2011


Report Document for CSC463 Projects

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.

Version 1.0 (Confidential) Page 4 of 9 REPORT/1.0/2011


Report Document for CSC463 Projects

2. Problem Formulation
2.1 State Space
Farmer, fox,
goose, grains

B A

Farmer, grains Fox, goose Farmer Fox, goose,


grains

B A B A

Farmer, goose Fox, grains Farmer, fox Goose, grains

B A B A

Goose Farmer, fox,


grains

B A

Farmer, goose, Fox Farmer, fox, Grains


grains goose

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

Farmer, fox, Goose


Fox, grains Farmer, goose grains

B A
B A

Farmer, fox, Initial State


goose, grains Terminate
Goal
Version 1.0 (Confidential)
B Page 5Aof 9 REPORT/1.0/2011
Report Document for CSC463 Projects

2.2 Well-Defined Problem

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.

Version 1.0 (Confidential) Page 6 of 9 REPORT/1.0/2011


Report Document for CSC463 Projects

A
Figure 2: Goal State

All the farmer action can be summarized as follow:


1. First, the farmer brings the goose from place A to place B.
2. Second, the farmer return back to place A.
3. Third, from place A the farmer brings a fox or some grains to place B.
4. Fourth, from place B the farmer brings back a goose to place A.
5. Fifth, from place A the farmer brings a fox or some grains to place B. (The one
that the farmer does not bring in step 3)
6. Sixth, the farmer return back to place A.
7. Lastly, the farmer brings goose to place B.

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.

Version 1.0 (Confidential) Page 7 of 9 REPORT/1.0/2011


Report Document for CSC463 Projects

3. Search Algorithm

In order to find the solution for this problem we choose to use algorithm from
heuristic search that is A* algorithm.

Version 1.0 (Confidential) Page 8 of 9 REPORT/1.0/2011


Report Document for CSC463 Projects

4. Program code

Version 1.0 (Confidential) Page 9 of 9 REPORT/1.0/2011

Das könnte Ihnen auch gefallen