Project Phase1
Project Phase1
Phase #1
Out date: October 16, 2016
Due date: November 10, 2016
Abstract
Artificial Intelligence is increasingly used in many real-life fields. Path finding, for example, is a very popular application of AI. It is concerned with finding
a valid path for an agent from an initial configuration to a goal configuration
through a maze that may contain obstacles. Path planning is very important
in games, map navigation, and robots. In the first phase of this project, you
should use the AI knowledge you acquired during studying the course to model
a path finding problem environment. In the next phase(s) you will need to write
the search algorithms that will solve the path finding problem or an extended
versions of it.
Introduction
We would like to formulate the robot map navigation problem (AKA the maze,
or the grid). You have a map consisting of a grid of square cells. some of the
cells are blocked (obstacles that the robot cannot walk through) and some are
empty (free areas). The robot is located at one of the empty cells, and it wants
to go to a goal cell. The robot is allowed to move one step at a time. The
possible moves are to the north, south, east, and west.
Project - Phase#1
CSC 361
The maze is a simple environment that you may have already been exposed
to sometime during the course. In this environment, the goal is to make the
robot find a path through the map that leads it to the treasure. To get there,
the robot can use 4 move actions: move-N,move-S,move-E,and move-W.These
actions will move the robot from its current cell to the next adjacent cell to the
north, south, east, or west, respectively.
Collisions should not happen in this map environment, as well as disobeying
other rules. Therefore, we need to put constraints on the robots actions. The
constraints are straight forward. For example, a robot cannot move to a blocked
cell. It also cannot walk past the hole, i.e., once the robot falls into a hole, it
cannot go out of it. It cannot go beyond the maps edges as well. These
constraints need to be formalized in your problem model, in addition to other
sensible constraints you think must be there. More about the constraints will
be presented in the next sections.
We also make some assumptions to simplify things. These assumptions can
be changed or removed in later phases of the project. The assumptions are:
Currently there is only one robot and at least one treasure.
The initial position of the robot and at least one of the treasures must be
in an empty cell.
There cannot be more than one copy of the robot or the treasure in one
cell. For example: there cannot be 2 treasures in one cell. There can be
a treasure and a robot in one cell though.
Given these assumption, however, you should not add more simplifying assumptions. For example, do not assume that the treasure cannot be in a hole.
Page 2/8
Project - Phase#1
CSC 361
Program Interface
Needless to say that your code should compile and run correctly. In this section
we introduce how we pass the input to your agent and get the output. The
executable file should accept two input parameters:
1. The name of the map file: [mapFile].
2. The name of the command file: [commandsFile].
The output should be stored in two files represented by the following parameters:
1. The log file: [logFile].
2. The final map file: [finalMapFile].
All of these files must be text-based, i.e. you can edit and view them using
a text editor. All files format will be explained in the next sections. Your
program must be invokable from the command prompt. The programs name
must be Agent. The usage should be as follow:
./Agent
[mapFile]
[commandsFile]
[finalMapFile]
[logFile]
or if you are using Java you should invoke it as an executable class as follows:
java
Agent
[mapFile]
[commandsFile]
[finalMapFile]
[logFile]
[mapFile]
[commandsFile]
[finalMapFile]
Files Format
There are three kinds of files: the map file, the commands file, and the log file.
The map file describes the map and its contents (the robots and the treasures)
at a certain point during the search. The command file represents a list of
moves which we will be providing you with in order to test how your code will
move the robot on the map. Initially you can use the command file given here.
The log file represents the output of each of the moves and whether they were
applied successfully. In the following we explain each file format in detail.
Page 3/8
Project - Phase#1
CSC 361
4.1
Page 4/8
Project - Phase#1
CSC 361
6
6
RBHB_B
_B____
_B_B_B
___B_H
_BBB_B
__HB_T
where the underscore symbol is used here to represent the space. Do not use
the underscore symbol in your output final map file.
In this phase of the project we will follow these simple notations. However,
we may change them in the next phases.
4.2
This input file contains a list of actions that your code will try to achieve. For
example, given the map of Figure 1, we may try to make the robot do a number
of moves using the following command file:
move-N
move-S
move-S
move-S
move-S
move-S
move-E
move-E
However, some of these moves cannot be achieved due to blocked cells or being
at the edge of the map, or for other reasons. For example the first move
(move-N) will not be achieved since it tells the robot to go north while it is
on the north edge of the map. In fact, this move attempt should cause the
program to report a failed action attempt in the log file. The remaining moves
should be OK, even though they will lead the robot to fall into a hole.
4.3
This output file reflects whether the commands were achieved or failed. So
given the command file above, the lines of the log file should be as follows:
FAIL
DONE
DONE
DONE
DONE
DONE
DONE
DONE
HOLE
Page 5/8
Project - Phase#1
CSC 361
Notice that the robot fill into a hole at the end. So, for each command, your
code should tell whether it was a successful or a failed move. For failed moves
add a FAIL line. For the successful moves add a DONE line. After a failed
move, assume that the robot did not make the move and is still in its previous
position. Whenever you realize that you reached a goal state, you should add
a GOAL line to the log file. If you fall into a hole, add a HOLE line. Notice that
you may continue to receive commands in all cases.
In addition to this file, your code should also create the final map file, which
represents the map after trying to achieve all of the moves in the command file.
The final map file will have the same format as a map file, but should usually
have different contents from the input map file.
If you want to do something more, try copying your project and extending it by
adding some more constraints and features to the environment. These features
will not be part of the evaluation. However, you may get extra marks if you did
them right. If you agree to submit an extended version of the code, you should
incrementally add some (or all) of the following features: robot battery, power
charging station, booster moves, and cell altitudes. Notice that the extensions
are ordered, so you cannot do the second before the first, etc. Do not submit
these with the main deliverables. Instead, submit them to me by email after
you submit the main code. It is important to separate the mandatory part
from the extension.
5.1
Battery
The robot will have a limited amount of power to move. Therefore, it may run
out of power while it tries to do the tasks. Add a battery to the robot.
5.2
Charge Stations
If you implement the battery, you will notice that the robot has a limited
amount of power, and it may run out of power as it tries to do the tasks. Add
a charger stations to the map (as a static feature), and add a charge action
that will give the robot the ability to move further.
5.3
Booster moves
Sometimes the robot wants to go fast. By moving fast the robot can get to
its goal in less time. However, the increase in speed means more force and
therefore consuming more energy.
You should add a new kind of actions: the booster moves. For example,
if you already have a move-N, move-S, move-E,and move-W, you should add
four more actions: move-N-B,move-S-B,... etc, representing the booster moves.
These new booster actions should move the robot two squares forward instead
of one. Also, they should spend three times the amount of power.
Page 6/8
Project - Phase#1
CSC 361
5.4
Altitude
Some empty cells are at higher altitude than the cell where the robot is standing
, so the robot may need to spend more energy to climb and reach them. Some
cells are lower than the robots cell that the robot does not need to spend the
normal amount of energy to reach them. Think about a way to include this
idea into your model. Implement it if you want!
The Report
In a small report (no more than 5 pages), write the formal problem definition
as discussed in class and in the book. Namely, find:
the state description, specifying explicitly the initial state.
the actions and their transition model.
the goal test.
the path cost (the step cost of the actions.)
The report should include the following sections: an introduction, a problem
description, the modeling (the formulation), a discussion, and a summary or a
conclusion (if you have any). In the problem description section, you should
write the problem in your own words. Then, you should specify the model in
the next section. In the discussion, you should clearly explain the points of
weakness and strength of your work. That is, write about any difficulties you
faced in the project. For example, if your code did not produce a correct log
file, write about it and explain the possible reasons. You should also write
about anything you think is positive or you think is important to mention.
For example, you may want to represent the maps graphically in your code!
However, if you produce a graphical map, then you should do it in addition to
the text based maps, and submit it separately. You may also add the extra
features and explain how you used them.
Deliverables
Page 7/8
Project - Phase#1
CSC 361
First, lets assume that your student ID is 433000123. Change this number to
your real ID when you are about to submit. You should submit everything
using LMS. You will find 3 links, one for each deliverable:
1. Under the Project/Phase 1/REPORT-SUBMIT link in LMS, you should
submit a PDF copy of your report. The file name should be:
433000123.report.pdf.
The report will go through a plagiarism test, where the percentage of
similarity with other reports (e.g. your colleagues, the Internet) is shown.
If you have a high similarity percentage, then I will check the report
further, since you might have copied something from other reports and
did not cite it. If I discover that this was the case, then it is
considered cheating, which will cause you to FAIL the project,
and perhaps the course.
2. Under the Project/Phase 1/SOURCE-AND-EXEC-SUBMIT link, you should
submit the source code and the executable file. The source code will
also go through a code plagiarism test. All files in this case should be put
in a flat ZIP file (i.e. there are no directories) called:
433000123.source-exec.zip.
3. Under the Project/Phase 1/OUTPUT-SUBMIT link, you should submit the
output files that resulted after running the code on the provided input
files. Notice that every student will be provided with input files for the
test, and these files may differ from student to student. Submit your
output files only. I will check if these were your original output files by
running your code. All files in this case will be put in a flat ZIP file called:
433000123.output.zip.
More about the input and output files naming convention might be given
to you later.
Notice that submitting on time is your responsibility. Late submissions will not
be accepted.
Important Guidelines
Write your name, student ID number, section number, and project phase
number on the report and as a comment in the code.
Work individually. Discussing the project with your colleagues is encouraged as long as there is not a transfer of code or text. Cheating will
not be tolerated.
Use LMS to submit the soft copy for all of the deliverables, including the
report, as described above. Emails will not be accepted.
Make your report be as clear, precise and concise as possible.
Page 8/8