首页
网站开发
桌面应用
管理软件
微信开发
App开发
嵌入式软件
工具软件
数据采集与分析
其他
首页
>
> 详细
COM1005程序辅导、讲解java编程语言、辅导java程序 讲解留学生Processing|讲解数据库SQL
项目预算:
开发周期:
发布时间:
要求地区:
Assignment: The Rambler’s Problem
COM1005 Machines and Intelligence
Semester 2: Experiments with AI Techniques
Heidi Christensen
University of Sheffield
Version 1.1
This assignment carries 30% of the marks for COM1005
DUE DATE: Friday 21st May 2021 at 23:59 (UK Time)
In this assignment you’ll experiment with search strategies for solving the Rambler’s problem.
The Problem
The problem is to work out the best walking route from a start point to a goal point, given
a terrain map for the walking area. A terrain map specifies the height of each point in the
area. Figures 1 shows an example of a realistic terrain map.
Figure 1: A realistic Terrain Map
A more simple terrain map is shown in Figure 2.
For a rambler, the best route is the one which involves the least climbing.
1
Figure 2: A simple Terrain Map. White is highest, black is lowest. This map is saved in
tmc.pgm
Representing Terrain Maps
We’ll store our terrain maps in Portable Grey Map (pgm1
) format.
In this format each cell is represented by an int from 0 to 255.
You can view and edit pgm files using irfanviewer - free download here: http://www.
irfanview.com or just a normal text editor as it is in fact just a normal text file.
In Figure 3 you can see a screenshot of the content of the tmc.pgm.
Figure 3: This is the content of the file tmc.pgm when viewed in a terminal window.
A pgm file contains a header followed by a matrix with the actual data. Figure 4 shows the
header information. Figure 5 shows the x- and y-axis definitions.
Code
Code for handling the terrain maps is in the code folder within the assignment folder.
1http://netpbm.sourceforge.net/doc/pgm.html
2
Figure 4: Header information in the pgm file.
Figure 5: PGM data matrix with x and y orientation.
You are provided with the file tmc.pgm and a java class TerrainMap whose constructor is
given the filename of a pgm image and reads its contents, i.e.,
1 // defining a new terrain map
2 TerrainMap tm = new TerrainMap("tmc.pgm");
TerrainMap has the following accessors:
1 // accessors
2 public int[][] getTmap() {
3 return tmap;
4 };
5
6 public int getWidth() {
7 return width;
8 };
9
10 public int getDepth() {
11 return depth;
12 };
13
14 public int getHeight() {
15 return height;
16 };
3
Rambler’s costs
The Rambler steps one pixel at a time North, South, East or West (not diagonally). An
upward step is more costly. The local cost c(y, x, y′
, x′
) of a step from (y, x) to (y
′
, x′
) is:
c(y, x, y′
, x′
) = {
1 if h(y
′
, x′
) ≤ h(y, x)
1 + |h(y
′
, x′
) − h(y, x)| otherwise.
(1)
where h(y, x) is the height in the terrain map at point (y, x).
NOTE, that y is written before x!
Figure 6: Illustration of a lowest cost route found from a start point (car park at (7,0)) and
point at (5,8).
What you must do
Using the Java code provided for the assignment do the following four tasks:
Task 0: Set up a GitHub (or similar) repository for keeping versions of your code as you
develop your solution. Make sure to push updates regularly. The purpose of using a git
repository is twofold: i) to develop good habits and practice around version control; ii)
in case of a suspicion of unfair means, you have clear evidence that code was developed
along the way by yourself. You must add the url of your github repository to your
LATEX report (I’ve added a nifty little footnote to the title where this info can go).
Task 1: Implement branch-and-bound for the Rambler’s problem Working with search4
code and following the procedure of taking a set of general classes and making a specific
solution for a particular problem, implement branch-and-bound search for the
Rambler’s problems. You will need to define a class RamblersState and a class
RamblersSearch. Look at the corresponding classes for Map Traversal (week3) for
guidance. You will also need a class for running the tests. Call this RunRamblersBB.
4
Task 2: Assess the efficiency of branch-and-bound Try out a number of start and
end points on the tmc map and assess the efficiency of branch-and-bound in this domain.
You may also create other Terrain Maps of your own, or make use of diablo.pgm
in the Rambler’s folder which is a terrain map of Mt Diablo in California. Tip: that
map is a lot bigger, so if your code takes a long time to run, consider editing the map
down.
Task 3: Implement A* search for the Rambler’s problem Working from the search4
code, implement A* search for the Rambler’s problem. Remember that for A* you
need (under)estimates of the remaining cost to the goal. Experiment with different
choices for this heuristics, for example:
1. the Manhattan Distance between the current pixel and the goal (p + q).
2. the Euclidean distance
3. the height difference
4. combinations of these
You may also devise other ways of combining the estimates. You will also need a class
for running the tests. Call this RunRamblersAstart.
Task 4: Compare the efficiency of branch-and-bound and A* Perform experiments
to test the hypothesis that A* is more efficient than branch-and-bound and that the
efficiency gain is better for more accurate heuristics.
Task 5: Produce a report Your experimental report should describe your implementations
and your results. Your report should include at the very least:
• Description of your branch-and-bound and A* search implementations.
• Presentation of results obtained when testing the efficiency of these two approaches.
• A comparison of the results - can you verify your hypothesis?
A LATEX report template is provided, with compulsory sections specified. You may add more
sections if you wish: include in your report what you think is interesting.
Note 1: you must use the LATEX template provided for your report. However, you will
not be marked on your ability to use LATEX to format your report (i.e., there are no extra
marks for making it look fancy!). That being said, LATEX is an essential piece of software
for communicating research and results in engineering and science, so we want you to get
experience using it early on.
Note 2: you should not have to make any changes to the Java code provided except to
control the amount of printout during a search and perhaps to modify what a successful
search returns. It’s a good idea to revisit the week 3 lab class for a reminder of how you
worked with branch-and-bound and A* searches.
5
Code
In the downloaded zip-file you will find a code/search3 folder. This is your working folder
where you should also develop your code. There are the usual classes that implements the
search engines (Search.java, SearchState.java and SearchNode.java).
In addition, you will find a class that can read a terrain map (TerrainMap.java) as well as
a class that easily enables you to handle coordinates (Coords.java). Finally, I’ve given you
test class to illustrate how you load a particular pgm file (TestTerrainMap.java).
1 /**
2 * TestTerrainMap.java
3 *
4 * Phil Green 2013 version
5 * Heidi Christensen 2021 version
6 *
7 * Example of how you load a terrain map
8 */
9
10 import java.util.*;
11 import java.io.File;
12 import java.io.FileNotFoundException;
13 import java.io.PrintWriter;
14 import java.util.Scanner;
15
16 public class TestTerrainMap {
17
18 /**
19 * constructor , given a PGM image Reads a PGM file. The maximum greyscale value
20 * is rescaled to be between 0 and 255.
21 *
22 * @param filename
23 * @return
24 * @throws FileNotFoundException
25 */
26
27 public static void main(String[] arg) {
28
29 TerrainMap tm = new TerrainMap("tmc.pgm");
30
31 System.out.println(tm.getWidth());
32 System.out.println(tm.getTmap()[7][2]);
33
34 }
35 }
Summary of assignment
1. Implement a branch-and-bound and an A* search for the Rambler’s problem using the
code provided.
2. Run your code with different start and end points and different heuristics (for A*) on
the different maps, to assess the efficiency of the two types of search algorithms.
3. Complete your report with the results and conclusions.
6
What to submit
Submit your solution, as a zipped file called SURNAME_FIRSTNAME.zip, where SURNAME is
your surname (family name), and FIRSTNAME is your first name (given name). This zip file
should contain:
• a .pdf copy of your report named SURNAME_FIRSTNAME.pdf
• your code.
Marking Scheme
Percentage points Categories and example score weights; Marks will be awarded according to these criteria:
40% Implementation of branch-and-bound and A* search
30% Sensible implementations of RamblersState and
RamblersSearch and the two respective test classes.
Note: marks will be deducted if your code doesn’t compile
and run on the command line. You can use your favourite
IDE but make sure that I can compile & run your code
from the command line in the search3 folder like this ”javac
RunRamblersBB.java” and ”java RunRamblersBB”. You will
lose marks, if I can’t do this without modifying code.
10% Well documented and well presented code. This is about using
comments to ease understanding of more complex parts of
the code, and the consistent use of indentations, brackets and
appropriate choices of variable names. Note, there isn’t much
code programming to do in this assignment ...).
40% Experimental results
15% Good assessment of efficiency of branch-and-bound. More
points are given for exploring a good number of different start
and end points.
25% Good assessment of efficiency of A*. More points are given
for exploring different estimates of the remaining costs to the
goal, and for exploring a good number of different start and
end points.
20% Documentation - quality of presentation and communication
of your experimental results in your report
10% Quality of communication of results in e.g. tables and figures
10% Quality of discussion of results and conclusions
100% Total
Marks and feedback will be returned through Blackboard within 3 weeks.
7
Rules
Unfair means: This is an individual assignment so you are expected to work on your own.
You may discuss the general principles with other students but you must not work together
to develop your solution. You must write your own code. All code submitted may be
examined using specialized software to identify evidence of code written by another student
or downloaded from online resources.
8
软件开发、广告设计客服
QQ:99515681
邮箱:99515681@qq.com
工作时间:8:00-23:00
微信:codinghelp
热点项目
更多
代做 program、代写 c++设计程...
2024-12-23
comp2012j 代写、代做 java 设...
2024-12-23
代做 data 编程、代写 python/...
2024-12-23
代做en.553.413-613 applied s...
2024-12-23
代做steady-state analvsis代做...
2024-12-23
代写photo essay of a deciduo...
2024-12-23
代写gpa analyzer调试c/c++语言
2024-12-23
代做comp 330 (fall 2024): as...
2024-12-23
代写pstat 160a fall 2024 - a...
2024-12-23
代做pstat 160a: stochastic p...
2024-12-23
代做7ssgn110 environmental d...
2024-12-23
代做compsci 4039 programming...
2024-12-23
代做lab exercise 8: dictiona...
2024-12-23
热点标签
mktg2509
csci 2600
38170
lng302
csse3010
phas3226
77938
arch1162
engn4536/engn6536
acx5903
comp151101
phl245
cse12
comp9312
stat3016/6016
phas0038
comp2140
6qqmb312
xjco3011
rest0005
ematm0051
5qqmn219
lubs5062m
eee8155
cege0100
eap033
artd1109
mat246
etc3430
ecmm462
mis102
inft6800
ddes9903
comp6521
comp9517
comp3331/9331
comp4337
comp6008
comp9414
bu.231.790.81
man00150m
csb352h
math1041
eengm4100
isys1002
08
6057cem
mktg3504
mthm036
mtrx1701
mth3241
eeee3086
cmp-7038b
cmp-7000a
ints4010
econ2151
infs5710
fins5516
fin3309
fins5510
gsoe9340
math2007
math2036
soee5010
mark3088
infs3605
elec9714
comp2271
ma214
comp2211
infs3604
600426
sit254
acct3091
bbt405
msin0116
com107/com113
mark5826
sit120
comp9021
eco2101
eeen40700
cs253
ece3114
ecmm447
chns3000
math377
itd102
comp9444
comp(2041|9044)
econ0060
econ7230
mgt001371
ecs-323
cs6250
mgdi60012
mdia2012
comm221001
comm5000
ma1008
engl642
econ241
com333
math367
mis201
nbs-7041x
meek16104
econ2003
comm1190
mbas902
comp-1027
dpst1091
comp7315
eppd1033
m06
ee3025
msci231
bb113/bbs1063
fc709
comp3425
comp9417
econ42915
cb9101
math1102e
chme0017
fc307
mkt60104
5522usst
litr1-uc6201.200
ee1102
cosc2803
math39512
omp9727
int2067/int5051
bsb151
mgt253
fc021
babs2202
mis2002s
phya21
18-213
cege0012
mdia1002
math38032
mech5125
07
cisc102
mgx3110
cs240
11175
fin3020s
eco3420
ictten622
comp9727
cpt111
de114102d
mgm320h5s
bafi1019
math21112
efim20036
mn-3503
fins5568
110.807
bcpm000028
info6030
bma0092
bcpm0054
math20212
ce335
cs365
cenv6141
ftec5580
math2010
ec3450
comm1170
ecmt1010
csci-ua.0480-003
econ12-200
ib3960
ectb60h3f
cs247—assignment
tk3163
ics3u
ib3j80
comp20008
comp9334
eppd1063
acct2343
cct109
isys1055/3412
math350-real
math2014
eec180
stat141b
econ2101
msinm014/msing014/msing014b
fit2004
comp643
bu1002
cm2030
联系我们
- QQ: 9951568
© 2021
www.rj363.com
软件定制开发网!