Due: Sunday 10 April, 11:59 pm
Marks: 16% of final assessment
The robot will be equipped with an array of 12 sonar sensors.
The maze will be composed of horizontal and vertical walls conforming to a rectangular grid with square cells of size 2 by 2 units.
Copy the file src.zip into your own directory and unzip it. You will see a directory with four java files and two shell scripts.
Compile the code by typing
./comp.sh hw1.java hw1Body.java hw1Brain.javaThe Java file
GenMaze.java
can be used to randomly generate
new mazes of a specified size, as follows:
javac GenMaze.java java GenMaze 6 > maze.inThe simulation can then be run by typing
./run.sh hw1 < maze.inYour task will be to provide the method
performBehavior()
in the file hw1Brain.java
(you may also add other methods, if you wish).
For this project, the method getCoords()
may be used to return a vector
indicating the current position of the robot in global co-ordinates.
You may assume that the centre of the maze is at (0,0,0)
and that it has an even number of rows and columns.
Although the robot does not have a light sensor,
you can use the method haveVisitedLight()
to check whether it has visited the light yet.
Briefly describe how your program works, including any algorithms and data structures employed, and explain any design decisions you made along the way.
give cs3411 hw1 hw1Brain.java
You must put all your code into one file, which must
be called hw1Brain.java
.
If you attempt to submit modified versions of the
other files, your modified versions will be
discarded and the original files used in their place.
You can submit as many times as you like - later submissions will overwrite earlier ones. You can check that your submission has been received by using the following command:
3411 classrun -check
The submission deadline is Sunday 10 April, 11:59 pm.
15% penalty will be applied to the (maximum) mark
for every 24 hours late after the deadline.
Additional information may be found in the FAQ and will be considered as part of the specification for the project.
Questions relating to the project can also be posted to the MessageBoard on the course Web page.
If you have a question that has not already been answered on the FAQ
or the MessageBoard, you can email it to your tutor, or to
cs3411.hw1@cse.unsw.edu.au
Group submissions will not be allowed. Your program must be entirely your own work. Plagiarism detection software will be used to compare all submissions pairwise and serious penalties will be applied, particularly in the case of repeat offences.
DO NOT COPY FROM OTHERS; DO NOT ALLOW ANYONE TO SEE YOUR CODE
Please refer to the Yellow Form, or to section on Originality of Assignment Submissions in the Unix Primer, as well as the CSE Addendum to the UNSW Plagiarism Policy if you require further clarification on this matter.
Good luck!