代写FIT5047-Assignment 1代写Python

FIT5047 Semester 1, 2020
Assignment 1(100 marks =20%)
Due Date: May 8,10:00pm


Submission: You have to submit two things i) your report (in pdf format) which
answers all questions (except programming) in this assignment in both Moodle link
and Turnitin; ii) your program file (one single .py file) for Question 1 in Moodle link.

Note 1: Please follow the University and Faculty policies and regulations regarding
Academic Integrity. Details please find from
https://www.monash.edu/__data/assets/pdf_file/0004/801841/Student-Academic-
Integrity-Policy.pdf

Note 2: You will be required to present your work during tutorial in week 8
individually. Please be prepared. This is compulsory in this assessment. Please be
aware that the time of interview might be subject to change. The time will be
determined by your lecturer and tutor.

Question-1: Problem Solving as Search (total marks 40)
The Problem:
Consider a grid of size N x N that represents a topographic map. Each tile describes
the characteristics of its terrain, which could be of two types: normal or mountainous.
ROBBIE the robot must navigate from a starting position (xs,ys) to a goal position
(xg,yg) using a learned algorithms (there can only be one start and one goal).
Note: In the explanations below, we assume that tile (1,1) is the top-left tile in the
map.
Transition rules:
ROBBIE is allowed to go to one of the (at most) eight surrounding tiles, as shown in
Figure 1(a). However, it cannot move to a mountainous tile, and it cannot move
diagonally if one of the directions composing the diagonal contains a mountainous
tile. For instance, the black tile in Figure 1(b) represents a mountain, hence ROBBIE
can move only to the five white tiles indicated by the arrows. In contrast, ROBBIE
can move to seven tiles in Figure 1(c).

Path cost:
ROBBIE’s wheels are built so that a diagonal move is the easiest. Hence, the cost of
such a move is 1. Any other move has a cost of 2.
The Task:
Your task is to write a Python 3 program called planpath that plans a path from a
given starting tile to a goal tile.
• You should implement either Graph or Treesearch procedure to perform A*.
• Propose and implement a heuristic function for solving this problem.
• Determine whether this function is admissible or monotonic, and explain why.
Is the resulting algorithm A or A*?
• You will need to implement tie-breaking rules when all options have equal
merit. Specify clearly in your documentation what are your tie-breaking rules.

Calling your program:
Your program will have two command line arguments as follows:
python planpath.py INPUT/inputi.txt OUTPUT/outputi.txt Flag
Flag where the folders INPUT and OUTPUT should reside in the same folder as your
program.
• inputi.txt – the name of the input file, where i is the number of the input file;
• outputi.txt – the name of the output file, where i is the number of the output
file;
• Flag – indicates how many node expansions require a diagnostic output (if it
is 0, no diagnostic output is required) – see the example later on in the
assignment.



Input:
• The first line will contain one number that specifies the number of rows and
columns in the map.
• Subsequent lines will contain the map, one line per row. The following values
will be accepted for each tile:

The following illustrates a procedure call and sample input for applying A/A* to a 3x3
map and printing diagnostic output for 5 iterations:
python planpath.py INPUT/input1.txt OUTPUT/output1.txt 5
where input1.txt is
3
SXR
RRR
XXG
Output:
Your program should produce a sequence of moves that ROBBIE should perform to
get from the start node to the goal, and the accumulated cost and ROBBIE’s position
after each move.
Output format:
• The sequence of moves should be formatted as a list of actions separated by
dashes followed by a blank space and the cost of the path according to the
algorithm. If no path was found, the output should state NO-PATH.
• The actions (in UPPER CASE) are: R (Right), RD (Diagonal Right-Down), D
(Down), LD (Diagonal Left-Down), L (Left), LU (Diagonal Left-Up), U (Up), RU
(Diagonal Right-Up).
• For example, a path that goes Start, Right, Right-Down, Down, Down, Left-
Down and Goal, with a total cost of 8, is represented as follows: S-R-RD-D-D-
LD-G 8

Programming Requirements:
• Your program should be written in Python 3.
• Your program can only utilize Panads and Numpy package instead of any
other advanced level packages.
• Your program should create a unique identifier for every generated node. The
identifier of the start node should be N0, and other nodes should be identified
as N1, N2, . . . according to the order in which they are generated. If you wish,
you can include the actions used to reach a node in its identifier, e.g., N0-R-D.
If you implement Graphsearch (as opposed to Treesearch), you need to
identify when a repeated instance of a node is reached, and use only the first
identifier created for this node.
• Your program should work on different maps, including those provided in
moodle.
• The Graph/Treesearch procedure should build a search graph/tree
respectively. Each node in the search graph/tree should have the following
components:
1. an identifier;
2. the operator that generated it;
3. order of expansion (if in CLOSED) otherwise 0;
4. the cost g of reaching that node;
5. a heuristic value h (0 for DLS);
6. a value f, where f=g+h;
7. a pointer to its children; and
8. a pointer to its parent (if you implement Treesearch, and your action
sequence is included in a node identifier, then this pointer is not
necessary).
• In diagnostic mode (Flag ≥ 1), each time a node is expanded, your program
should output the following components:
1. node identifier;
2. order of expansion;
3. the cost g of reaching that node;
4. a heuristic value h;
5. a value f, where f=g+h;
6. the resolution of pointer to its children, i.e., the identifier of each child of
the expanded node and the action that generated it;
7. the lists OPEN (sorted in descending order of merit) and CLOSED. The
value of Flag will be small, so don’t worry about OPEN and CLOSED
being too long. Failure to print OPEN and CLOSED will result in loss of
marks.

Output example:
Say node N0:S at position (1, 1) is the first node to be expanded by some search
algorithm not A*. The output for this step should be something like the following:
• N0:S 1 0 0 0 # ID expansion-order g, h, f
• Children: {N1:S-R, N2:S-RD, N3:S-D }
• OPEN: {(N1:S-R 2 0 2), (N2:S-RD 1 0 1), (N3:S-D 2 0 2) }
• CLOSED: {(N0:S 1 0 0 0)}
Question 2: First order logic, representation (2× 4 = 8)
Use the following vocabulary to express the assertions in the following sentences:
– MALE(x) means that the object denoted by x is male.
– FEMALE(x) means that x is female.
– VEGETARIAN(x) means that x is a vegetarian.
– BUTCHER(x) means that x is a butcher.
– LIKES(x, y) means that x likes y.
a. No man is both a butcher and a vegetarian.
b. All men except butchers like vegetarians.
c. The only vegetarian butchers are women.
d. No man likes a woman who is a vegetarian.
Question 3: Unification (2 × 2 = 4)
In the following pairs of expressions, w, x and y are variables, A and B are constants,
and f and g are functions. Do these pairs of expressions unify? If they do, give the
substitution that unifies them. If they don’t, then indicate where the unification fails.
a. P(x,f(x),A,A) and P(y,f(A),y)
b. P(x,f(x,y),g(x,w)) and P(A,f(w,B),g(w,x))
Question 4: Resolution refutation ((4 × 2 + 2 × 0.5) + (4 × 1) + 11 =
24)
Consider the following statements:
1. A student is successful if s/he has high grades.
2. Students who are bright and work hard have high grades.
3. Students who are not bright fail CSEXXX.
4. Students who do not work hard have lots of fun.
5. James is not having any fun.
6. James passed CSEXXX
a. Use the predicates SUCCESSFUL, HIGH-GRADES, BRIGHT, WORK-HARD,
HAS-FUN and PASS (the opposite of FAIL) to represent these statements as
predicate calculus formulas. DO NOT include STUDENT as a predicate, as it
complicates the solution.
b. Convert these statements to clauses.
c. Use resolution refutation to prove that James is a successful student.


Question 5: Resolution refutation ((2 × 2 + (4 × 1) + (6 + 10) = 24)
Consider the following statements:
1. Every boy or girl is a child.
2. Every child gets a doll or a train or a lump of coal.
3. No boy gets a doll.
4. No child who is good gets a lump of coal.
a. Use the predicates BOY, GIRL, CHILD, GET-DOLL, GET-TRAIN, GET-
COAL and GOOD to represent these statements as predicate calculus
formulas.
b. Convert these statements to clauses.
c. Use resolution refutation to prove that if no child gets a train, then no boy
is good.

Also note:
• Students should submit a file called
FIT5047_StudentId_1stSem2020_Asst1.pdf to the relevant place on Moodle.
• Students using a .py program in Question 1 should also submit a second file
is: FIT5047_StudentId_1stSem2020_Asst1.py
• Please note that StudentID refers to your Student ID number. So, as an
example, if your StudentId is 12345678 and you submit a Python file, then you
should submit two files, respectively called
FIT5047_12345678_1stSem2020_Asst1.pdf and
FIT5047_12345678_1stSem2020_Asst1.py .
• Recall notes on page 1 about Academic Integrity and about the requirement
for your attending an interview as a compulsory part of your assessment.




---- END OF FIT5047 1st Semester 2020 Assignment 1 ----

热门主题

课程名

omp9727 ddes9903 mgt253 fc021 int2067/int5051 bsb151 babs2202 mis2002s phya21 18-213 cege0012 math39512 math38032 mech5125 mdia1002 cisc102 07 mgx3110 cs240 11175 fin3020s eco3420 ictten622 comp9727 cpt111 de114102d mgm320h5s bafi1019 efim20036 mn-3503 comp9414 math21112 fins5568 comp4337 bcpm000028 info6030 inft6800 bcpm0054 comp(2041|9044) 110.807 bma0092 cs365 math20212 ce335 math2010 ec3450 comm1170 cenv6141 ftec5580 ecmt1010 csci-ua.0480-003 econ12-200 ectb60h3f cs247—assignment ib3960 tk3163 ics3u ib3j80 comp20008 comp9334 eppd1063 acct2343 cct109 isys1055/3412 econ7230 msinm014/msing014/msing014b math2014 math350-real eec180 stat141b econ2101 fit2004 comp643 bu1002 cm2030 mn7182sr ectb60h3s ib2d30 ohss7000 fit3175 econ20120/econ30320 acct7104 compsci 369 math226 127.241 info1110 37007 math137a mgt4701 comm1180 fc300 ectb60h3 llp120 bio99 econ7030 csse2310/csse7231 comm1190 125.330 110.309 csc3100 bu1007 comp 636 qbus3600 compx222 stat437 kit317 hw1 ag942 fit3139 115.213 ipa61006 econ214 envm7512 6010acc fit4005 fins5542 slsp5360m 119729 cs148 hld-4267-r comp4002/gam cava1001 or4023 cosc2758/cosc2938 cse140 fu010055 csci410 finc3017 comp9417 fsc60504 24309 bsys702 mgec61 cive9831m pubh5010 5bus1037 info90004 p6769 bsan3209 plana4310 caes1000 econ0060 ap/adms4540 ast101h5f plan6392 625.609.81 csmai21 fnce6012 misy262 ifb106tc csci910 502it comp603/ense600 4035 csca08 8iar101 bsd131 msci242l csci 4261 elec51020 blaw1002 ec3044 acct40115 csi2108–cryptographic 158225 7014mhr econ60822 ecn302 philo225-24a acst2001 fit9132 comp1117b ad654 comp3221 st332 cs170 econ0033 engr228-digital law-10027u fit5057 ve311 sle210 n1608 msim3101 badp2003 mth002 6012acc 072243a 3809ict amath 483 ifn556 cven4051 2024 comp9024 158.739-2024 comp 3023 ecs122a com63004 bms5021 comp1028
联系我们
EMail: 99515681@qq.com
QQ: 99515681
留学生作业帮-留学生的知心伴侣!
工作时间:08:00-21:00
python代写
微信客服:codinghelp
站长地图